2016-11-17 115 views
0

我在IIS中有一個WordPress站點,當我將wordpress中的永久鏈接設置更改爲/%postname%/ i時,每篇文章中都會出現404錯誤。 web.config文件具有以下Wordpress IIS永久鏈接導致錯誤404

<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

您是否嘗試過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> 
+0

是的,我並沒有什麼 –