Solved

Friendly URLS in MVC 2 application

Posted on 2010-09-02
6
513 Views
Last Modified: 2013-12-17

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
0
Comment
Question by:MrAgile
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 15

Expert Comment

by:AmmarR
ID: 33585514
0
 
LVL 27

Expert Comment

by:nmarun
ID: 33585670
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
0
 
LVL 8

Author Comment

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

Does this make sense?
0
Cloud Training Guides

FREE GUIDES: In-depth and hand-crafted Linux, AWS, OpenStack, DevOps, Azure, and Cloud training guides created by Linux Academy instructors and the community.

 
LVL 15

Expert Comment

by:AmmarR
ID: 33605916
Dear MrAgile:

when i go to the link you mentioned, i get 404 error and the page redirects again
404.png
0
 
LVL 27

Accepted Solution

by:
nmarun earned 500 total points
ID: 33606580
0
 
LVL 8

Author Comment

by:MrAgile
ID: 33655476
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
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question