HttpContext.RewritePath(string filePath, string pathInfo, string
queryString).
I call it in Application_BeginRequest (Global.asax.cs), and then in the
page load (default.aspx) write it back to the requested url. The code
is something like:
1) if the requested file is an ".axd" (resource handler request, such
as for freetextbox) then return without rewrite
2) check if requested physical page exists on the server, and if so
return without rewrite (to allow hardcoded pages to be accessible)
3) process the requested url and see if you know what it means. In
your case check the last folder name, look the user up, if they do not
exist, return without rewrite so a 404 error occurs. If they do exist,
call rewrite path with your new url.
4) you really should write the url back to the original in the page
load if you expect that page to post back to the server. Otherwise
when they post back they will not see your hackable (friendly) url in
the address bar anymore, but instead see your rewritten url.
This resource may help:
http://odetocode.com/blogs/scott/arc...01/01/509.aspx
You can look at my site to see the friendly urls in use. None of the
following pages physically exist on the server. They are all really
just default.aspx, which you can also access directly:
http://www.xquisoft.com/Products/VersionPolicy.aspx http://www.xquisoft.com/Products/Portal/Overview.aspx http://www.xquisoft.com/Products/Portal/Progress.aspx http://www.xquisoft.com/home.aspx
are all really just...
http://www.xquisoft.com/default.aspx
Michael Lang
XQuiSoft LLC
(XQuiSoft Portal Framework)
http://www.xquisoft.com/