本文介绍了Web配置-将具有域的特定URL重定向到另一个URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将testdomain/diamonds/silver重定向到testdomain/diamonds.
I would like to redirect testdomain/diamonds/silver to testdomain/diamonds.
我需要指定域,因为该网站具有多个附加域.
I need to have the domain specified because the website has several domains attached to it.
这就是我现在所拥有的,但它似乎无能为力.
This is what i have now, but it does not seem to do anything.
<rule name="testredirect" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAny"> <add input="{HTTP_HOST}" pattern="^testdomain/diamonds/silver" /> </conditions> <action type="Redirect" url="/diamonds" redirectType="Permanent" /> </rule>我也尝试过这样做,但是那也不起作用.
I have also tried this, but that did not work either.
<rule name="testredirect" stopProcessing="true"> <match url="^testdomain/diamonds/silver" ignoreCase="true" /> <action type="Redirect" url="/diamonds" redirectType="Permanent"/> </rule>有什么建议吗?
我知道了.在下面回答!
推荐答案最后.
这有效:
<rule name="redirect diamonds" stopProcessing="true"> <match url="^diamonds/diamondrings" ignoreCase="true" /> <conditions> <add input="{HTTP_HOST}" pattern="^(www.)?mywebshop.azurewebsites" /> </conditions> <action type="Redirect" url="/diamondrings" redirectType="Permanent" /> </rule>更多推荐
Web配置
发布评论