【发布时间】:2013-01-25 12:45:08
【问题描述】:
我在 IIS7 上的 ASP.NET 4.0 中使用了一个重写规则:
<system.webServer>
<rewrite>
<rules>
<rule name="Rewrite default to aspx" stopProcessing="true">
<match url="^$" ignoreCase="false" />
<action type="Rewrite" url="home.aspx" />
</rule>
</rules>
</rewrite>
<defaultDocument>
<files>
<add value="home.aspx" />
</files>
</defaultDocument>
</system.webServer>
此规则采用:(http:/example.com/aboutus.aspx) 并从 URL 的末尾删除 .aspx。我在子域 (http:/www.example.com/blog) 上安装 wordpress 时遇到问题,由于我的重写规则,我收到以下错误:
描述:HTTP 404。您要查找的资源(或其依赖项之一)可能已被删除、名称已更改或暂时不可用。请检查以下 URL 并确保其拼写正确。
请求的 URL:/blog/.aspx
有谁知道我可以如何修复 URL 重写规则,使其安全地到达 (http://www.example.com/blog/) 并且不在末尾添加 .aspx?
是否有某种语法可以搜索博客子目录以忽略目录'/blog/'?
非常感谢!谢谢! :)
【问题讨论】:
标签: url-rewriting