简体   繁体   中英

Setting up URL Rewrite rule for a specific domain SEO

On Google there is the following Url

www.domain.ch/House/rent

So now my page is now available in multi language and i have now the language in the url, and it looks like this

www.domain.ch/en/house/rent

So I will redirect all old links with url rewrite in the web.config, but I can't find out the match condition to find out if there is a languege insite the url.

My role:

<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>

Thanks for any help!

<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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM