我在ASP.NET web.config文件中使用以下代码将“ www”请求重定向到我的安全网站:
<rewrite>
<rules>
<clear/>
<rule name="httpsredirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{REQUEST_URI}" />
</rule>
</rules>
</rewrite>
目的是确保有人进入
他们被重定向到
。
问题在于重定向在将它们发送到安全站点时效果很好,但是目标URI丢失了,因此它们被发送到站点的根默认页面。这里有什么帮助吗?谢谢!马上
尝试改变
<action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{REQUEST_URI}" />
至
<action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句