.NET life

HUGON Jérôme
Microsoft Certified Technology Specialist Microsoft Certified Application Developer Microsoft Certified Professional

URL Rewriting for SEO: Enforce canonical host names

IIS7

Category IIS7  | Publication Date : 1/24/2010

Search engines will treat http://www.hugon.ws and http://hugon.ws as two separate websites. Search rankings are surely going to drop, given that search engines believe that 2 sites should share the benefit of having the same content.

The solution is quite simple: HTTP 301 redirect http://hugon.ws to http://www.hugon.ws with a rewrite rule:

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

Below is a screen shot of the Edit Rule UI in IIS:

URL Rewriting for SEO: Enforce canonical host names - IIS7


Related articles

URLs, globalization and localization on multilingual websites

Category Miscellaneous  | Publication Date : 11/27/2010

URL Rewriting for SEO: Enforce canonical pages

IIS7

Category IIS7  | Publication Date : 1/24/2010

URL Rewriting for SEO: Convert/Force URLs to Lower Case

IIS7

Category IIS7  | Publication Date : 1/24/2010