Most of our projects are short term and of a promotional nature. As a result, our clients often want to put up some sort of "end of program" or "expired" page when the promotion is over. How do I do a blanket redirect of all controller actions to one specific controller action without modifying each controller and its methods? Is this even possible?
Ideally, in pseudocode, I'd like to be able to do something like this:
// somewhere in global.asax
if (current_action_url != desired_action_url)
redirect to desired_action_url
I tried doing simple string matching on the URL:
if (!Request.Url.AbsolutePath.ToLower().EndsWith("path/to/desired/page"))
Response.Redirect("path/to/desired/page");
However, since I'm still using IE 6 and have to use the wildcard hack, IE was redirecting all requests to the page (even images and stylesheets) which messes things up pretty badly.