【发布时间】:2016-06-20 09:54:29
【问题描述】:
我正在尝试将 /company/ 中的任何页面(包括根 /company/ 本身)重定向到另一个页面。
这是我目前得到的:
<httpRedirect enabled="true" exactDestination="true" httpResponseStatus="Permanent">
<add wildcard="*/company/*" destination="/another/page/" />
</httpRedirect>
这可行,但是它具有重定向路径中包含 /company/ 的任何其他文件(图像、脚本等)的副作用。
我可以强制它只重定向 .aspx 文件,但它不会重定向根文件夹 /company/
<add wildcard="*/company/*.aspx" destination="/another/page/" />
如何使用 IIS httpRedirect 模块 做到这一点?
有很多使用 IIS URL 重写模块的重定向示例,但不幸的是我无法在实时服务器上安装该模块。
【问题讨论】: