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

Game Development: Text 101 - Text Based Game With Finite State Machine

This time, I've created a really simple text based game that allow the player to progress state to another state by choosing some option...