【发布时间】:2015-07-13 18:02:59
【问题描述】:
我正在使用这个答案https://stackoverflow.com/a/13861795/848513,它非常适用于我的网站上不再存在的静态文件,以转发到新的文件位置。
但我也有一些需要转发到新位置的动态 URL,而以下代码似乎不起作用:
作品:
<rule name="SpecificRedirect50" stopProcessing="true">
<match url="aboutus.php" /> <!-- static URL -->
<action type="Redirect" url="/about-us" redirectType="Permanent" />
</rule>
不起作用:
<rule name="SpecificRedirect1" stopProcessing="true">
<match url="topic.php?id=39" /> <!-- dynamic URL-->
<action type="Redirect" url="/folder/?id=520" redirectType="Permanent" />
</rule>
我在尝试访问 www.site.com/topic.php?id=39 时遇到的错误是 404 Not Found 错误 - 即,它没有被重写脚本过滤。
格式应该是什么?
谢谢
【问题讨论】:
标签: mod-rewrite iis-7