.NET life

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

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

IIS7

Category IIS7  | Publication Date : 1/24/2010

URLs can be defined in uppercase and lowercase. That means they are treated as different pages by a search engine, even if they point to the same resources and content.

The best way to handle this issue is to rewrite the URL to lowercase and respond to the "old" capitalized version with an HTTP 301 response (Permanently moved).

Here is the rule:

<rule name="Convert to lowercase" stopProcessing="true">  
    <match url=".*[A-Z].*" ignoreCase="false" />  
    <action type="Redirect" url="{ToLower:{R:0}}" redirectType="Permanent" />
</rule>

Below is a screen shot of the Edit Rule UI in IIS for the lowercase enforcement rule:

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


Related articles

URL Rewriting for SEO: Enforce canonical pages

IIS7

Category IIS7  | Publication Date : 1/24/2010

URL Rewriting for SEO: Enforce canonical host names

IIS7

Category IIS7  | Publication Date : 1/24/2010