Intercept .asp requests and redirect to corresponding .aspx page

T

Tifer

I'm hoping someone here can help me. We have a rather large site
that's undergoing a conversion from Classic ASP to .Net. It's pretty
much been rewritten already. Let's say there was a /Travel.asp page,
the new corresponding .Net page would be /Travel/Default.aspx

We can easily create a config (xml) file with entries for each page
and it's corresponding redirect page.

But the question is, how do I intercept these requests and then
redirect to the correct converted page?

Someone in our department suggested that HttpHandler may be the
answer, but in setting that up, we run into errors with the way the
site is currently coded. It seems all functions and subs must be
between <script></script> tags rather than <% %>. Otherwise, we get
the following error:

"Statement cannot appear within a method body. End of method assumed."

There's no way this would be a feasible solution seeing as how large
our site is, and to be honest, how poorly it was designed in the past.
Think of the spaghetti model...

So I think that option is out - unless someone has gotten this to work
and I'm just doing something wrong.

Basically I'm thinking any option that would require asp.net's dll to
process our .asp pages would be a no-go because of this.

So then I've read about ISAPI filters, and from my understanding,
incoming requests to IIS are intercepted, but when it goes to the
final page, the correct .dll will process the page still. No changes
required to which .dll process which extension. Before I go digging
in this direction, I was hoping for a little advice.

One other final way would be just to call a function in one of our
master includes (I'm sure hoping this include is in every page) and
handling the logic in there.

Thanks in advance,

Chris T.
 
M

Michael J. Ryan

create a custom 404 .aspx page that will first look to see if the new page in
question is in the map file, and do a permanent redirection, or show the
generic 404... set this as the 404 handler in iis... not just for .net

alternatively use the rewrite module with win2008 server, which will work a
little nicer.
 

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