Force URL to lower case in ASP.NET using web.config

ASP.NET Comments Off on Force URL to lower case in ASP.NET using web.config

If your hosting company has IIS rewrite module installed, then you can force all the url in the browser to be in lower case. This is good for SEO as google will see only one url  eg. LOWERCASE.ASPX and lowercase.aspx will both point lowercase.aspx page

[sc:tcbox ]
<rewrite>
            <rules>
                <rule name="LowerCaseRule1" stopProcessing="true">
                    <match url="[A-Z]" ignoreCase="false" />
                    <action type="Redirect" url="{ToLower:{URL}}" />
                </rule>
            </rules>
        </rewrite>
[sc:/tcbox ]

 



Author

Search

Back to Top