is it possible to redirect a static seo “friendly” url address to a controller/action without loosing the original address?
For example:
-
if you navigate to http://localhost/find-the-best-employees
-
under the hood MVC takes you to http://localhost/Search/Employees (SearchEmployee controller, Index action). But the idea is to keep the address http://localhost/find-the-best-employees.
How can I make this work on ASP.NET MVC 2.0?
I was having a look at here and here with no luck during tests.
In Global.asax define a route like:
For this to work you need to use the route-name when generating the url, using this html helper
Also you need to define this route before the default route: