WordPress去除index.php后文章頁打不開的解決辦法
來源:易賢網 閱讀:1136 次 日期:2014-08-18 14:35:19
溫馨提示:易賢網小編為您整理了“WordPress去除index.php后文章頁打不開的解決辦法”,方便廣大網友查閱!

今天打開自己的博客,發(fā)現網站的內頁都不能訪問了,我用的是Windows主機空間,主機支持Rewrite。win主機不能像Linux主機空間那樣直接在后臺設置固定鏈接,如果你要修改的話,鏈接中一定要帶index.php這個,否則就會提示系統(tǒng)找不到文件。。問了度娘和谷歌,答案是可以通過404跳轉或httpd.ini達到wordpress固定鏈接靜態(tài)化的目的,但怎么也實現不了。無奈,又問度娘和谷歌,終于找到一種方法,使用web.config設置wordpress固定鏈接靜態(tài)化:

<?xml version=”1.0″ encoding=”UTF-8″?>

<configuration>

<system.webServer>

<httpErrors errorMode=”Detailed” />

<asp scriptErrorSentToBrowser=”true”/>

<rewrite>

<rules>

<clear />

<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>

<rule name=”chinese tag” stopProcessing=”true”>

<match url=”/tag/(.*)” />

<conditions logicalGrouping=”MatchAll” />

<action type=”Rewrite” url=”/index.php?tag={R:1}” />

</rule>

<rule name=”www” stopProcessing=”true”>

<match url=”.*” />

<conditions>

<add input=”{HTTP_HOST}” pattern=”^urlt$” />

</conditions>

<action type=”Redirect” url=”http://www.url/{R:0}” redirectType=”Permanent” />

</rule>

</rules>

</rewrite>

</system.webServer>

</configuration>

特別說明:

1. 該段代碼只有IIS 7下能生效。

好吧,最后我的問題得到了完美的解決。不知道怎樣想的,win主機商升級了,都不告訴我一下啊。

更多信息請查看IT技術專欄

更多信息請查看CMS教程
由于各方面情況的不斷調整與變化,易賢網提供的所有考試信息和咨詢回復僅供參考,敬請考生以權威部門公布的正式信息和咨詢?yōu)闇剩?/div>
相關閱讀CMS教程
關于我們 | 聯系我們 | 人才招聘 | 網站聲明 | 網站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 加入群交流 | 手機站點 | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網安備53010202001879號 人力資源服務許可證:(云)人服證字(2023)第0102001523號
聯系電話:0871-65317125(9:00—18:00) 獲取招聘考試信息及咨詢關注公眾號:hfpxwx
咨詢QQ:526150442(9:00—18:00)版權所有:易賢網