Configuration:
For example you have domain anime.com that is powered by wordpress, you set up permalinks to use postname so post will be accessible at http://anime.com/postname.
The problem is when you create a sub-domain, for example shounen.anime.com and set permalinks like that of the main domain so that you can do SEO. Obviously this will not work as the main domain permalinks will interfere, so you have to set a redirect rule.
Taken into account that it's a windows hosting, therefore we need to configure Web.config rather than .htaccess.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="wordpress" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
0 nhận xét:
Đăng nhận xét