我想重寫一個Mediawiki網站中的網址,並且一切看起來正在根據失敗的請求日誌文件輸出工作。然而,正在顯示的頁面是原始頁面,而不是重寫中的網址。基本上,我想
www.website.com/State/City/Category
在
www.website.com/index.php?title=Special:RunQuery/CategoryPage&CategoryPage[State]= State&CategoryPage[City]=City&CategoryPage[Category]=Category&wpRunQuery=true
而似乎是展示在
www.website.com/index.php?title=State/City/Category
印刷_SERVER頁面顯示的頁面顯示QUERY_STRING作爲特別:RunQuery頁,但在其他方面所有其他變量顯示index.php或/ State/City/Category。我的web.config重寫規則看起來像這樣:Web配置重寫規則不顯示正確的頁面
<rewrite>
<rules>
<rule name="Root Hit Redirect" stopProcessing="true">
<match url="^$" />
<action type="Rewrite" url="/index.php?title=Main_Page" />
</rule>
<rule name="RedirectUserFriendlyURL1" stopProcessing="true">
<match url="^index\.php$" />
<conditions>
<add input="{REQUEST_METHOD}" pattern="^POST$" />
<add input="{QUERY_STRING}" pattern="^title=([^=&]+)$" />
</conditions>
<action type="Redirect" url="{C:1}" appendQueryString="false" />
</rule>
<rule name="RewriteUserFriendlyCategoryURL" 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?title=Special:RunQuery/CategoryPage&CategoryPage[State]={UrlDecode:{R:1}}&CategoryPage[City]={UrlDecode:{R:2}}&CategoryPage[Category]={UrlDecode:{R:3}}&wpRunQuery=true" />
</rule>
<rule name="RewriteUserFriendlyURL1" 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?title={UrlDecode:{R:1}}" />
</rule>
</rules>
</rewrite>
感謝任何幫助,以弄清楚這一個。現在我已經打了2天腦子。謝謝!
讚賞您檢查出來。我嘗試了失敗的請求追蹤,就像我上面所說的,一切似乎都沒問題。在日誌結尾處,它執行了一個看起來不錯的重寫操作,規則評估顯示了新的查詢字符串,重寫結束顯示了index.php的請求url,然後它向完整正確的字符串發出請求,然後以200成功。我想知道的是,也許Mediawiki正在尋找其他的東西,並根據其他變量提供不同的頁面。 Request_URI仍然設置爲/ State/City/Category。你可以改變web.config中的Request_URI和其他_Server變量嗎? –