我想重定向 url 来自http://example.com/page-name/?id=45 http://example.com/page-name/?id=45 to http://example.com/page-name/45 http://example.com/page-name/45在 IIS 的 web.config 中。
我该如何编写 web.config 的规则?
我正在使用下面的代码
<rule name="Redirect to url" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^page-name/([^/]+)/?$" />
</conditions>
<action type="Redirect" url="page-name/?id={R:0}" redirectType="Permanent" />
</rule>
但如果我使用此代码,我会收到 404 错误。这段代码有什么问题?
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)