Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Elad Lachmi 112 posts 144 karma points
    Jun 02, 2011 @ 12:09
    Elad Lachmi
    0

    redirect from subdomain to root domain

    I had my Umbraco installation in a subdomain while the site was under development. Google indexed it somehow and now I have links in the Google index to the subdomain. I want to redirect traffic from the subdomain to the root domain with a 301 result code.

    What would be the best way to do this in Umbraco?

    Thank you!

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jun 02, 2011 @ 14:57
    Tom Fulton
    1

    Hi Elad,

    One approach would be to create a rewrite rule using IIS, something like below, which should 301 redirect any non www.yourdomain.com traffic to www.yourdomain.com

    <rule name="Canonical host name" stopProcessing="true">
      <match url="(.*)" />
        <conditions>
          <add input="{HTTP_HOST}" pattern="^www.yourdomain\.com$" negate="true" />
        </conditions>
      <action type="Redirect" redirectType="Permanent" url="http://www.yourdomain.com/{R:1}" />
    </rule>

    Taken from this blog post:  URL Rewriteing and SEO

    Hope this helps,
    Tom

Please Sign in or register to post replies

Write your reply to:

Draft