views:

103

answers:

3

I have a page, called foo.aspx and i d like to rewrite the url as bar.something

How to do this? How does url rewrite happens in asp.net

Should i create a generic handler?

or should i get some url rewrite modules and add to app?

+2  A: 

This is done by configuring IIS, and will require IIS7, look here for configuration help: http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/

marr75
i have IIS7....
What @marr75 is (correctly) trying to say is that you need to configure this in IIS. It's got nothing (or maybe not much) to do with ASP.NET.
scherand
Edited to resolve the ambiguity.
marr75
A: 

visit the following link http://www.micronovae.com/ModRewrite/ModRewrite.html

JKS
I don't recommend this when he already has freely included software which just needs to be configured. Adding a third party dependency seems a complex and unnecessary expense.
marr75
+1  A: 

Remember, you also have the new Routing option with ASP.NET 4.0:

http://stackoverflow.com/questions/90112/iis-url-rewriting-vs-url-routing

You should also check this SO response:

http://stackoverflow.com/questions/90112/iis-url-rewriting-vs-url-routing

Some basic info on the differences between URL Re-Writing and Routing:

http://learn.iis.net/page.aspx/496/iis-url-rewriting-and-aspnet-routing/

IrishChieftain