![](/img/trans.png)
[英]URL Rewrite issues on IIS 7.0 with subdomains, not present on IIS 7.5
[英]iis 7.5 rewrite to friendly url issues
我正在從Apache遷移到IIS,並且遇到URL重寫問題。
我想要這樣的所有請求:
http://192.168.0.44/aaa/bbb/ccc/testword
查詢這個不友好的URL:
http://192.168.0.44/aaa/bbb/ccc/index.php?word=testword
所以我的web.config是:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="RewriteUserFriendlyURL1" stopProcessing="true">
<match url="^192\.168\.0\.44/aaa/bbb/ccc/([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="192.168.0.44/aaa/bbb/ccc/index.php?word={R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
但是當我訪問這樣的URL時,出現404 not found錯誤。 細節:
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL http://192.168.0.44:80/aaa/bbb/ccc/testword
Physical Path C:\inetpub\wwwroot\aaa\bbb\ccc\testword
Logon Method Anonymous
Logon User Anonymous
我究竟做錯了什么 ?
PS將有一個域,而不是那個IP,只是我想在我進行現場測試之前先在本地對其進行測試。
安裝了重寫模塊2。 我可以在iis manager gui中看到。
提前致謝。
我刪除了此重寫規則,該規則位於最頂層,並以最簡單的方式(沒有長路徑和IP)在最深的文件夾(ccc)中實現。 它自動地工作了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.