By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,967 Members | 2,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,967 IT Pros & Developers. It's quick & easy.

Redirects

P: n/a
I have a web app that works fine on the development machine and on several
servers running Win2k IIS 5 and Windows2003 IIS 6. But I am having an issue
on one particular erver running Win2k IIS 5, but has an Apache server
sending redirects to this server.

My problem is when I try to do a

Response.Redirect ("~/somepage.aspx")

The page calling the Response.Rediect is in the same directory as the
somepage.aspx, but I get 404 Page Not Found Error. This happens everytime.
The test app I was working with was as simple as having two web forms, and
in the page load of the first have the redirct to the other.

Another piece of info that may be of relevance is that the web app is
running on port 90 because the Apache runs on 80. The Apache configuration
file looks something like

Proxypass /dw/ http://machine.company.location.md.us:90/
ProxyPassreverse /dw/ http://machine.company.location.md.us:90/

So www.mainsite.com/dw/ would redirect to my server using port 90.

Also the application runs fine if ran from the server itself. I only have
the problem when accessing the app over the internet through the Apache
server.

Any help would be greatly appreciated.

Thanks

Mar 17 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
when you use Response.Redirect, by default asp.net generates a fully
qualified url. in your case

Response.Redirect ("~/somepage.aspx")

returns:

http://machine.company.location.md.u.../somepage.aspx

which is bypassing the proxy. you should turn off fully qualified redirects
in the HttpRuntimeSection. once you turn it off I don't believe ~ operator
will work, you will have to do relative redirects.

-- bruce (sqlwork.com)

"Stan Canepa" <sc*****@docksidesoftware.com> wrote in message
news:Oo*************@TK2MSFTNGP10.phx.gbl...
I have a web app that works fine on the development machine and on several
servers running Win2k IIS 5 and Windows2003 IIS 6. But I am having an
issue
on one particular erver running Win2k IIS 5, but has an Apache server
sending redirects to this server.

My problem is when I try to do a

Response.Redirect ("~/somepage.aspx")

The page calling the Response.Rediect is in the same directory as the
somepage.aspx, but I get 404 Page Not Found Error. This happens
everytime.
The test app I was working with was as simple as having two web forms, and
in the page load of the first have the redirct to the other.

Another piece of info that may be of relevance is that the web app is
running on port 90 because the Apache runs on 80. The Apache configuration
file looks something like

Proxypass /dw/ http://machine.company.location.md.us:90/
ProxyPassreverse /dw/ http://machine.company.location.md.us:90/

So www.mainsite.com/dw/ would redirect to my server using port 90.

Also the application runs fine if ran from the server itself. I only have
the problem when accessing the app over the internet through the Apache
server.

Any help would be greatly appreciated.

Thanks

Mar 17 '06 #2

P: n/a
Thus wrote Stan,
I have a web app that works fine on the development machine and on
several servers running Win2k IIS 5 and Windows2003 IIS 6. But I am
having an issue on one particular erver running Win2k IIS 5, but has
an Apache server sending redirects to this server.

My problem is when I try to do a

Response.Redirect ("~/somepage.aspx")

The page calling the Response.Rediect is in the same directory as the
somepage.aspx, but I get 404 Page Not Found Error. This happens
everytime. The test app I was working with was as simple as having two
web forms, and in the page load of the first have the redirct to the
other.

Another piece of info that may be of relevance is that the web app is
running on port 90 because the Apache runs on 80. The Apache
configuration file looks something like

Proxypass /dw/ http://machine.company.location.md.us:90/
ProxyPassreverse /dw/ http://machine.company.location.md.us:90/

So www.mainsite.com/dw/ would redirect to my server using port 90.

Also the application runs fine if ran from the server itself. I only
have the problem when accessing the app over the internet through the
Apache server.


Running a proxy like Fiddler (www.fiddlertool.com) should reveal the problem.
What I think happens is that
Response.Redirect ("~/somepage.aspx")
produces something like
HTTP/1.1 302 Found
Server: Microsoft-IIS/5.1
Date: Fri, 17 Mar 2006 17:44:04 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Location: /<YourApplicationRoot>/somepage.aspx

That would be wrong: It doesn't access the rewritten path /dw/. I can actually
create a similar issue by just using another redirection virtual directory
in IIS. The fix is to create the redirect location manually.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Mar 17 '06 #3

P: n/a
Thus wrote Bruce,
when you use Response.Redirect, by default asp.net generates a fully
qualified url. in your case

Response.Redirect ("~/somepage.aspx")

returns:

http://machine.company.location.md.u.../somepage.aspx

which is bypassing the proxy. you should turn off fully qualified
redirects in the HttpRuntimeSection. once you turn it off I don't
believe ~ operator will work, you will have to do relative redirects.


Are you sure? According to MSDN and my own observations, it's set to false
by default. Anyway, it's a better approach than constructing the URL manually,
but there may be situations in which it cannot be avoided.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Mar 17 '06 #4

P: n/a
I was looking information up on
HttpRuntimeSection.UseFullyQualifiedRedirectUrl and have found that it is
new to the .Net Framework version 2. The site was written in VS 2003
framework version 1.1.4322. I have a feeling you are right about the path.
Any other ideas about how I might go about fixing the issue? Do you think
Transfer would work?
"Bruce Barker" <br******************@safeco.com> wrote in message
news:O%****************@TK2MSFTNGP11.phx.gbl...
when you use Response.Redirect, by default asp.net generates a fully
qualified url. in your case

Response.Redirect ("~/somepage.aspx")

returns:

http://machine.company.location.md.u.../somepage.aspx

which is bypassing the proxy. you should turn off fully qualified redirects in the HttpRuntimeSection. once you turn it off I don't believe ~ operator
will work, you will have to do relative redirects.

-- bruce (sqlwork.com)

"Stan Canepa" <sc*****@docksidesoftware.com> wrote in message
news:Oo*************@TK2MSFTNGP10.phx.gbl...
I have a web app that works fine on the development machine and on several servers running Win2k IIS 5 and Windows2003 IIS 6. But I am having an
issue
on one particular erver running Win2k IIS 5, but has an Apache server
sending redirects to this server.

My problem is when I try to do a

Response.Redirect ("~/somepage.aspx")

The page calling the Response.Rediect is in the same directory as the
somepage.aspx, but I get 404 Page Not Found Error. This happens
everytime.
The test app I was working with was as simple as having two web forms, and in the page load of the first have the redirct to the other.

Another piece of info that may be of relevance is that the web app is
running on port 90 because the Apache runs on 80. The Apache configuration file looks something like

Proxypass /dw/ http://machine.company.location.md.us:90/
ProxyPassreverse /dw/ http://machine.company.location.md.us:90/

So www.mainsite.com/dw/ would redirect to my server using port 90.

Also the application runs fine if ran from the server itself. I only have the problem when accessing the app over the internet through the Apache
server.

Any help would be greatly appreciated.

Thanks


Mar 17 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.