IIS 7.5重写友好的URL发出
问题描述:
我从阿帕奇迁移到IIS,我面临着URL重写的问题。IIS 7.5重写友好的URL发出
我想这样所有的请求:
http://192.168.0.44/aaa/bbb/ccc/testword
查询这不是友好的网址:
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没有找到错误。详情:
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
我做错了什么?
p.s.会有一个域名了,而不是知识产权,它只是我想先在本地测试我做直播前。
重写模块2安装。我可以在iis经理gui看到。
在此先感谢。
答
我删除了这是在顶层,并实现了它在它的最简单的方法(不长的路径和IP)中最深的文件夹(CCC)这个重写规则。它自动工作。
请关闭,它解决了 – MIrrorMirror 2013-02-18 14:29:29
它甚至更好,如果你可以发表你的解决方案作为一个答案,并接受它。 – cheesemacfly 2013-02-18 15:12:02