Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Rewrite asp url as aspx url?

Reply
Thread Tools

Rewrite asp url as aspx url?

 
 
=?Utf-8?B?VA==?=
Guest
Posts: n/a
 
      07-22-2005
Hi group,

I'm trying to create a temporary replacement scheme for a particular url
that gets generated all over an existing app. It would be very difficult to
find every spot where the url gets created. So I'm thinking of doing a url
rewrite solution where i look for the url signature at the application (or
higher?) level. The twist is that the original url is classic asp. So how
do I grab this asp url from a .net httpmodule (or other thing) and redirect
the request to an aspx page? Of course you can't map .asp files to
aspnet_isapi.dll in IIS. Can this be done?

Thanks for any ideas...
 
Reply With Quote
 
 
 
 
Marina
Guest
Posts: n/a
 
      07-22-2005
Keep the original ASP page, and replace all of its code with a redirect to
its ASPX counterpart.

"T" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi group,
>
> I'm trying to create a temporary replacement scheme for a particular url
> that gets generated all over an existing app. It would be very difficult
> to
> find every spot where the url gets created. So I'm thinking of doing a
> url
> rewrite solution where i look for the url signature at the application (or
> higher?) level. The twist is that the original url is classic asp. So
> how
> do I grab this asp url from a .net httpmodule (or other thing) and
> redirect
> the request to an aspx page? Of course you can't map .asp files to
> aspnet_isapi.dll in IIS. Can this be done?
>
> Thanks for any ideas...



 
Reply With Quote
 
 
 
 
gerry
Guest
Posts: n/a
 
      07-22-2005
you can map anything and everything to aspnet_isapi.dll in IIS.

we commonly map .htm .html and .asp to aspnet_isapi.dll and rewrite the url
when the request hits our web app.








"T" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi group,
>
> I'm trying to create a temporary replacement scheme for a particular url
> that gets generated all over an existing app. It would be very difficult

to
> find every spot where the url gets created. So I'm thinking of doing a

url
> rewrite solution where i look for the url signature at the application (or
> higher?) level. The twist is that the original url is classic asp. So

how
> do I grab this asp url from a .net httpmodule (or other thing) and

redirect
> the request to an aspx page? Of course you can't map .asp files to
> aspnet_isapi.dll in IIS. Can this be done?
>
> Thanks for any ideas...



 
Reply With Quote
 
=?Utf-8?B?VA==?=
Guest
Posts: n/a
 
      07-22-2005
if i set up a mapping of .asp file to aspnet_isapi, how do i handle the many
cases where asp.dll needs to handle a request? i only want to rewrite
certain .asp requests that match a signature i'm looking for, e.g.,
MyPage.asp?mode=5 would be mapped to MyNewPage.aspx, whereas
MyPage.asp?mode=4 should be processed by asp.dll.

Here's what happened: someone wrote a GIGANTIC asp page that handles all
sorts of stuff based on a "mode." It posts to itself and takes different
paths based on which mode its in, i.e., update, display, etc. To add to the
devastation, the code in question runs inside of an iframe, so I can't
Server.Transfer or Redirect in the asp code.

thanks

"gerry" wrote:

> you can map anything and everything to aspnet_isapi.dll in IIS.
>
> we commonly map .htm .html and .asp to aspnet_isapi.dll and rewrite the url
> when the request hits our web app.
>
>
>
>
>
>
>
>
> "T" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi group,
> >
> > I'm trying to create a temporary replacement scheme for a particular url
> > that gets generated all over an existing app. It would be very difficult

> to
> > find every spot where the url gets created. So I'm thinking of doing a

> url
> > rewrite solution where i look for the url signature at the application (or
> > higher?) level. The twist is that the original url is classic asp. So

> how
> > do I grab this asp url from a .net httpmodule (or other thing) and

> redirect
> > the request to an aspx page? Of course you can't map .asp files to
> > aspnet_isapi.dll in IIS. Can this be done?
> >
> > Thanks for any ideas...

>
>
>

 
Reply With Quote
 
jasonkester
Guest
Posts: n/a
 
      07-23-2005
Nice. Looks like you have three options:

1. Modify the giant SWITCH statement in MyPage.asp to redirect as
necessary.
2. Map .asp to aspnet_isapi and .asp2 to asp.dll. Build a webform with
a giant SWITCH statement that redirects back to MyPage.asp2 as
necessary.
3. write an ISAPI filter with a giant SWITCH statement to fix the
incoming URLs before they make it to that page.

At any point, you could replace that switch statement with a table
lookup if you wanted to save yourself some grief and tedium.

Good luck!

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

 
Reply With Quote
 
gerry
Guest
Posts: n/a
 
      07-24-2005
ok - you didn't mention the 'selectively' part

in that case jason about covers the options.

one question though - why do you say that you can't transfer or redirect
because it is in an iframe - why should that matter ?



"T" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> if i set up a mapping of .asp file to aspnet_isapi, how do i handle the

many
> cases where asp.dll needs to handle a request? i only want to rewrite
> certain .asp requests that match a signature i'm looking for, e.g.,
> MyPage.asp?mode=5 would be mapped to MyNewPage.aspx, whereas
> MyPage.asp?mode=4 should be processed by asp.dll.
>
> Here's what happened: someone wrote a GIGANTIC asp page that handles all
> sorts of stuff based on a "mode." It posts to itself and takes different
> paths based on which mode its in, i.e., update, display, etc. To add to

the
> devastation, the code in question runs inside of an iframe, so I can't
> Server.Transfer or Redirect in the asp code.
>
> thanks
>
> "gerry" wrote:
>
> > you can map anything and everything to aspnet_isapi.dll in IIS.
> >
> > we commonly map .htm .html and .asp to aspnet_isapi.dll and rewrite the

url
> > when the request hits our web app.
> >
> >
> >
> >
> >
> >
> >
> >
> > "T" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Hi group,
> > >
> > > I'm trying to create a temporary replacement scheme for a particular

url
> > > that gets generated all over an existing app. It would be very

difficult
> > to
> > > find every spot where the url gets created. So I'm thinking of doing

a
> > url
> > > rewrite solution where i look for the url signature at the application

(or
> > > higher?) level. The twist is that the original url is classic asp.

So
> > how
> > > do I grab this asp url from a .net httpmodule (or other thing) and

> > redirect
> > > the request to an aspx page? Of course you can't map .asp files to
> > > aspnet_isapi.dll in IIS. Can this be done?
> > >
> > > Thanks for any ideas...

> >
> >
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UpdatePanel ( url rewrite) 2nd post back url changes Martin ASP .Net 0 04-28-2010 11:47 AM
Rewrite the URL in ASP? Advo ASP General 7 08-06-2006 05:24 PM
Problems with asp.net level URL rewrite baroque Chou ASP .Net 1 03-10-2006 01:27 AM
URL Rewrite to classic ASP =?Utf-8?B?amF2YXd6bA==?= ASP .Net 0 04-29-2005 08:47 PM
Rewrite URL without using .aspx? DDK ASP .Net 1 03-02-2004 06:20 AM



Advertisments