[英]Setting up URL Rewrite rule for a specific domain SEO
在Google上有以下网址
www.domain.ch/House/rent
所以现在我的页面现在可以使用多种语言了,而且我现在在网址中有了该语言,看起来像这样
www.domain.ch/en/house/rent
因此,我将使用web.config中的url重写来重定向所有旧链接,但是我无法找到匹配条件来确定网址中是否有语言。
我的角色:
<rule name="mydomain.com" >
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^(localhost:3005/|localhost:3005/)$" />
</conditions>
<action type="Redirect" url="http://localhost:3005/de/{R:1}" logRewrittenUrl="true" />
</rule>
谢谢你的帮助!
<rule name="mydomain.com" stopProcessing="true" >
<match url="(.*)" />
<conditions>
<!-- redirect only if the URL doesn't contain /en/ or /de/ already (negate = true)-->
<add input="{URL}" pattern="/en/|/de/" negate="true" />
</conditions>
<action type="Redirect" url="de/{R:1}" />
</rule>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.