Context.RewritePath method doesn't work as expected

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
-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-
 
R

Roger Willcocks

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top