Welcome to Professional ASP.NET - Chris Love's Official Blog Sign in | Join | Help

Chris Love's Official ASP.NET Blog

Chris Love's Helpful tips, tricks and pragmatic development knowledge for the ASP.NET world.
Add to Technorati Favorites


ASP Insider
URLMapping or URL Rewriting

URLMapping or URL Rewriting as is is sometimes called, is very important to make your site people and search engine friendly.  The later releases of DotNetNuke included this functionality, which is important because DotNetNuke tends to not be search engine friendly at all and I can prove this with my sites.  This is one of the reasons I decided to abandon it, but that is another story.

Anyway, I found several blog entries around the net on URL Mapping in ASP.NET 2.0.  I found it to be extremely easy.  Scott Guthrie has a quick entry that reminded me of this.  So does Fritz Onion, Microsoft, and finally the big one that contains Regular Expression URL Mapping.

Anyway, I love this stuff.  Here is an example of how I have my web.config setup to map some static content pages to the correct page to handle these URLs.  It works like champ!  Christopher Pietschmann's Blog has the code you will need to create the underlying classes.

<httpModules>

<add type="RegExUrlMapping_HTTPModule.RegExUrlMappingModule" name="RegExUrlMappingModule" />

</httpModules>

<!-- The RegEx URL Mapping parser goes through these in sequential order. -->

RegExUrlMapping enabled="true">

<add url="~/t/(.*)/default.aspx" mappedUrl="~/content.aspx?PageName=$1" />

</RegExUrlMapping>

Posted: Monday, February 06, 2006 4:04 PM

by Chris Love
Filed under: ,

Comments

Professional ASP.NET said:

This will have to be part one of two entries. I am about to start migrating a few rather large DotNetNuke sites to ASP.NET 2.0 and I want to make sure that any links people have to the pages are handled corrrectly. The best way I think to do this is the set up a 310 Redirect handler
# February 14, 2006 4:59 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS