Wednesday, May 6, 2015

ASP.NET Tips: Redirecting all uppercase letter in URL into lowercase URL

For the purpose of SEO, sometimes we need a way to enforce all URL into lowercase. In order to do that in an ASP.NET project, we can add a URL rewrite rules in the web config file inside the system.webserver tag.

Here is the configuration of URL rewrite looks like:

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

Please leave a comment if you find my post useful. Happy coding programmers! :)

No comments:

Post a Comment

Tips: How to ssh to your Digitalocean server without password

If you are tired of being asked for a password when accessing your remote droplet servers in Digitalocean, you might consider adding an rsa ...