[英]IIS redirect rule not working
<rule name="Directories The" stopProcessing="true">
<match url="^Directories/The" />
<action type="Redirect" url="/" />
</rule>`
我有两个网址,例如www.mydomain / Directories / the和www.mydomain / Directories / the-hindu。 但是我只想只重定向第一个URL。 如果我把上面的代码两个URL重定向。
我尝试使用完全匹配,但通配符也不起作用。 我不希望www.mydomain / Directories / the-hindu进入我的主页
`
问题是您的正则表达式^Directories/The
与两个URL匹配:
您需要将字符串条件的末尾添加到您的正则表达式中。 正确的规则应为:
<rule name="Directories The" stopProcessing="true">
<match url="^Directories/The$" />
<action type="Redirect" url="/" />
</rule>`
并且此规则将仅匹配www.mydomain/Directories/the
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.