我在IIS中有一个wordpress网站,当我将wordpress中的永久链接设置更改为/%postname%/ i时,每篇文章都会出现错误404。 web.config文件包含以下内容
<rewrite>
<rules><rule name="Plesk. Wordpress redirect wpConfigRule #70e3895f-b537-474a-8e6e-f5c31e888d54" stopProcessing="true"><match url="^wp-config.php$" ignoreCase="false"/><action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden"/></rule>
<rule name="WordPress: http://domain.com" patternSyntax="Wildcard">
<match url="*"/>
<conditions>
<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>
在谷歌搜索后我发现这是正确的。
我还应该检查什么来解决它?
答案 0 :(得分:0)
您是否尝试过wordpress文档中的web.config文件? https://codex.wordpress.org/Using_Permalinks#Permalinks_without_mod_rewrite
你发布的那个看起来像plesk特有的东西,试试这个:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WordPress Rule" stopProcessing="true">
<match url=".*" />
<conditions>
<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>