Introduction:
In this article,i am going to explain about how to rewrite the url’s using asp.net and c#.
Main:
Rewriting url’s are really a very important task for commercial websites,
Normal url:http://netprogramminghelp/asp.net/page.aspx?MyTitleId=1
After URL Rewriting URL is changed to
http://netprogramminghelp/asp.net/Better-and-Simplest-way-to-rewriting-url’s.aspx
Here i used URLRewriter.Net which is available free. Download URLRewriter.Net.Please follow my below simple
steps,
1.Download UrlRewriter.net,
2.Add Refrence to yours application,
3.Update app.config, //add the url’s you wnats to change
<rewriter>
<rewrite url="~/asp.net/(.+)-(.+).aspx" to="~/Page.aspx?MyTitleId=1"/>
</rewriter>
<rewriter> <rewrite url="~/asp.net/(.+)-(.+).aspx" to="~/Page.aspx?MyTitleId=1"/> </rewriter> |
thatsit,
Conclusion:
Hope this helps,
Happy Coding.
The ASP.NET application works just as if it was working with dynamic URLs. Article Rewriter