Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 15, 2007 08:44 AM by reteep
Dec 14, 2007 10:40 AM|LINK
I'd really like to shift one of my projects to MVC, but I'm curious about the URL Rewriting. I currently use the UrlRewriting.Net dll for friendly URLs in my ASP.NET Project. So I'm adding stuff like this to my web.config:
<add virtualUrl="^~/Profil/(.*)/Games/Plattform/(.*)/Seite/(.*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/Profil.aspx?u=$1&do=Games&sys=$2&p=$3" ignoreCase="true" />
If I add MVC now and use the new URL Controllers - does anyone already have some experience if both will be able to co-exist?
Dec 14, 2007 03:14 PM|LINK
The good news is that you really don't need urlrewriting. the new routing engine removes the file based urls and virtual urls is baked into the system. Take a look at some of the blog post about the url routing on ScottGu blog and others. If you still
have questions post back.
Dec 14, 2007 04:34 PM|LINK
One thing to keep in mind is that url rewriting actually rewrites the URL from the perspective of ASP.NET.
The MVC framework doesn't do rewriting, it does routing. The URL never changes. I'd agree with jcteaque, url rewriting is probably unecessary with MVC. If you have an old URL you wish to support and map to a new url, you could probably model it with a Route.
Dec 15, 2007 08:44 AM|LINK
Sounds great, thanks!