Iis URL重写根本不起作用
我在IIS 7.5中安装了url重写模块,并执行了一个简单的url完全匹配入站规则,然后重定向用户..但当我转到url时,它根本不会重定向我,它只是加载页面..我还检查了web配置,发现此错误元素systsem.webserver的元素重写无效..下面是我拥有的web.config xmlIis URL重写根本不起作用,iis,url-rewriting,Iis,Url Rewriting,我在IIS 7.5中安装了url重写模块,并执行了一个简单的url完全匹配入站规则,然后重定向用户..但当我转到url时,它根本不会重定向我,它只是加载页面..我还检查了web配置,发现此错误元素systsem.webserver的元素重写无效..下面是我拥有的web.config xml <system.webServer> <httpErrors> <remove statusCode="404" subStatusCod
<system.webServer>
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/default.aspx" responseMode="ExecuteURL" />
</httpErrors>
<rewrite>
<rules>
<rule name="redirect" patternSyntax="ExactMatch" stopProcessing="true">
<match url="http://localhost:8989/pay.htm" negate="false" />
<action type="Redirect" url="http://localhost:8989" appendQueryString="false" redirectType="Temporary" />
</rule>
</rules>
</rewrite>
</system.webServer>
我在这里做错了什么,还是配置了错误的模块。我试图重新安装并重新安装,但没有成功。IIS重写无法与本地主机一起工作。 不管怎样,你的规则应该是这样的
<rule name="redirect" stopProcessing="true">
<match url="^/?pay\.htm$" />
<action type="Redirect" url="http://www.domain.com" appendQueryString="false" redirectType="Temporary" />
</rule>
这也不起作用。它只加载原始页面,不重定向。是否尝试使用http://localhost:8989/pay.htm
?你用我的规则代码试过了吗?是的,我用..试过了,我用你的代码更新了web.config。我忘了在规则中转义圆点。我编辑了我的答案,你能再试一次吗?嘿,谢谢你的回答。问题是它在某些情况下不适用于本地主机。它只是完全绕过了IIS