Welcome to MSDN Blogs Sign in | Join | Help

Donkblog

Adventures into the world of amateurgramming. I'll leave the programming to the professionals.
PathInfo - Url Rewriting for the Simple

Request.PathInfo gives you what is past the file name but before '?' which starts the query string.  So instead of doing www.foo.com/bar.aspx?var1=value you could do www.foo.com/bar.aspx/var1/value.  This helps a lot with SEO because search engines will think they are different pages. 

 

When I go to the URL http://localhost:64245/PathTest/Default.aspx/foo/bar (my development environment server) I see a PathInfo like I show below:

 

path

If you want more control over your URL rewriting or want to get rid of the .aspx in the URL you will need to take a different approach. I suggest you take a look at UrlRewriter.NET.

Posted: Monday, March 10, 2008 8:06 AM by Brandon Turner

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: 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

Page view tracker