Link to home
Start Free TrialLog in
Avatar of MrAgile
MrAgileFlag for Australia

asked on

Friendly URLS in MVC 2 application


Hi There,

I would like to find out the best way to render friendly URLS in my MVC 2 application. Can anyone post some code for this.

I'm wanting a url like http://www.mydomain.com/some-folder/some-file.aspx.

Thanks in advance,

Sean
Avatar of AmmarR
AmmarR
Flag of Bahrain image

Sean,

MVC does provide user-friendly urls by default. So the MVC url might look something like:

http://site.com/product/edit/123
as against
http://site.com/EditProduct.aspx?id=123

The second one is how WebForms do it. Another benefit of the first one is that search engines can cache these urls, but not the latter one. I'm sure you agree that something like:
http://site.com/products/display/laptops

is a lot more intuitive than
http://site.com/DisplayProducts.aspx?id=72

So, I'm not sure what exactly you mean by user-friendly urls. Please explain.

Arun
Avatar of MrAgile

ASKER

Hi Nmarun, looking for seo friendly urls in particular. Something like mydomain.com/my-folder/my-page/

Does this make sense?
Dear MrAgile:

when i go to the link you mentioned, i get 404 error and the page redirects again
404.png
ASKER CERTIFIED SOLUTION
Avatar of nmarun
nmarun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MrAgile

ASKER

Hi Arun,

The link I gave you was just in the format I required. Thanks for the links above, that's exactly what I was after.

Sean