CODEDIGEST
Home » Articles
Search
 

Technologies
 

CodeDigest Navigation
 

Technology News
No News Feeds available at this time.
 

Community News
No News Feeds available at this time.
 
URL Mapping in ASP.Net 2.0

By Satheesh Babu
Posted On Jun 08,2008
Article Rating:
Be first to rate
this article.
No of Comments: 1
Category: ASP.Net
Print this article.

URL Mapping in ASP.Net 2.0

 

ASP.Net 2.0 provides a simple way to map a long URL to a short URL with the help of   <urlMappings> tag in Web.Config. With this feature URL rewritting becomes simple but with some big limitations.

For example,

 

  <urlMappings>

      <add url="~/Csharp.aspx"       

           mappedUrl="~/Articles/Csharp/Default.aspx"/>

      <add url="~/ASPNet.aspx"        

           mappedUrl="~/Articles/ASPNet/Default.aspx"/>

      <add url="~/Framework.aspx"        

           mappedUrl="~/Articles/Framework/Default.aspx"/>

    </urlMappings>

 



The above config settings routes the user to the URL given in mappedUrl property and thus makes the URL very simple and easily rememberable.

The drawback of this feature is when our websites grows drastically then maintaining this section in config file will be tedious.  To overcome this we can build a URL rewriting module using Regular expression.

The following article will help you in building this module.

URL Rewritting with regular expression.

 

Happy Coding!!!

Similar Articles
You can contribute to CodeDiget.Com:
Donate to CodeDigest.com
Article Feedback
Comments
url mapping
what is the difference between url rewriting and url mapping