Context.RewritePath method doesn't work as expected

  • Thread starter Thread starter Aaron Prohaska
  • Start date Start date
A

Aaron Prohaska

I'm trying to use the Context.RewritePath method to change the internal
path being used when a user tries to browse a directory that doesn't
exist anymore. Unfortionately I've found that this is not possible
because the BeginRequest event doesn't get fired if the directory
doesn't exist. So now I can't use this to redirect users when they
browse a folder location that has changed or been removed. Is this by
design or is there some work around?

Regards,

Aaron Prohaska

-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-
Wrench Science Inc.
http://www.wrenchScience.com/
Phone: 510.841.4748 x206
Fax: 510.841.4708
-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-
 
In Global.asax, handle Application_OnError
check the exception types
when it is a 404, determine the new location and redirect [I'd suggest using
a 301 so the search engines move the link]

Or otherwise handle the missing file as desired.
 
Back
Top