Response.Redirect and Apache Forward

L

Lionel

Hi,

I've a VB .Net web app (for example foo) on an internal server. In the
intranet we can access this application like this :
http://myserver/foo/index.aspx.

Now we want to make this application available on the Internet. We 've
set up an Apache forwarding on our LAN and we can access the
application :

http://www.fooapp.com/index.aspx is OK

But there is a problem each time we are using a Response.Redirect in
our code (in a postback for example).

For example if we want to redirect to index2.aspx (using
Response.Redirect("index2.aspx"), which is a webform located in the
same directory than index.aspx it fails on the Internet with a 404
error code because the we are redirected to :

http://www.fooapp.com/foo/index2.aspx and not to
http://www.fooapp.com/index2.aspx

Note : when you try to do the same Response.Redirect in an ASP (and not
..Net) page :it is OK !!! No additionnal /foo!

Have you an idea? (other than using Server.Transfer, we want to keep a
"true" URL on the client browser)

Thanks for your answers

Lionel
 
B

Bruce Barker

asp.net does more munging of the url then asp. it appends the base dir to
the url (to help you). this means in your redirect url is relative to the
domain, not the current page.

when you do Response.Redirect("index2.aspx") from
mysite.com/foo/mypage.aspx , asp.net actually sends

Location: /foo/index2.aspx

where asp sent

Location: Redirect: index2.aspx

you will have to hack redirect location yourself.

Response.RedirectRedirect("index2.aspx",false); // don't end yet
Response.RedirectLocation = "index2.aspx;"; // override asp.net location
Response.End();

or you could just send the header yourself.

-- bruce (sqlwork.com)
 

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

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top