2013-09-27 32 views
4

enter image description here漂亮的永久鏈接結構不工作的Godaddy主機上使用Windows主機和IIS服務器

上圖爲我的問題,要經過很多的博客,Godaddy的支持,堆棧溢出的問題。面對這個問題從一個月起,所以最後Stack社區來幫忙。

在我的根文件夾中沒有web.config文件,但.htaccess文件更改不會影響永久鏈接。 我應該創建這種固定鏈接結構www.example.com/category/postname作爲我目前的永久鏈接結構做的是託管服務器 Godaddy的與Windows主機enviornment的 http://www.example.com/?page_id=104 細節和IIS 7的服務器。 Godaddy don'nt在這裏有幫助中心的任何知識。

+0

檢出[codex](http://codex.wordpress.org/Using_Permalinks)並搜索iis – gwillie

+0

@gwillie我讀過這個,但did'nt找到解決方案。 iis 7提供url重寫並尋找web.config。所以等待一些人爲提到的永久鏈接結構提供確切的web.config。謝謝 –

+1

我提供的頁面上有一個鏈接,它鏈接到[iis網站](http://www.iis.net/learn/extensions/url-rewrite-module/enabling-pretty-permalinks-in-wordpress)。 @Uzair粘貼的內容來自該頁面 – gwillie

回答

24

您需要web.config建立在你的WordPress安裝的根目錄web.config文件(相同的目錄.htaccess文件),並添加以下代碼:

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
    <rewrite> 
     <rules> 
      <rule name="wordpress" 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> 
    </system.webServer> 
</configuration> 

這將使在漂亮的永久鏈接帶有在IIS上運行的URL重寫的WordPress。

+1

tumbs upp buddy,你立刻解決了我的問題。工作很好n優秀。剛剛複製粘貼n上傳。 感謝您的幫助 –

+1

非常感謝,因爲這是我第一次在URL Rewrite上使用windows server的經驗。所以它真的爲我工作 –

+0

謝謝它適用於我godaddy plesk – EBS

相關問題