Classic ASP redirect issue

The code below:

Response.Redirect("../agent/info.asp")

Fails in Firefox.  Works in Chrome, IE and Safari.

This:

Response.Redirect("/agent/info.asp")

Fails with all 4.

This:

Response.Redirect("agent/info.asp")

only works in Firefox.

Is this really this complicated?  Firefox handles redirects differently than the others?
Sheldon LivingstonConsultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

G_HCommented:
You need to send the complete URL:

Response.redirect("http://www.example.com/agent/info.asp")

GH
0
Sheldon LivingstonConsultantAuthor Commented:
Wow... so is this just a shortcoming with Firefox?
0
G_HCommented:
Remember this is not a link on a web-page, it is a HTTP header, which is returned to the Browser for processing.

As such, it is probably handled differently to the way a "relative link" on a web-page would be.

I am sure the people at Moz would say "...FF handles your request properly according to the RFC...".

GH
0
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

smeghammerCommented:
Hi,

As G_H says, you need a fully qualified URL. All the refs I can find with a quick search use fully qualified URL as the redirect parameter. e.g.:

http://www.w3schools.com/asp/met_redirect.asp

Cheers
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
depending on what, if any info you're passing along, you may be able to get away with

Server.Transfer "/agent/info.asp"

not a solution per se, more of a work around. That's really odd it's failing in FF though, I've always been able to use the format you've specified, in all browsers...
0
G_HCommented:
AS The_Big_Daddy says, you can use Server.Transfer.

The only caveat I would add is you really need to "bring your A game" when using it, as the URL in the browser does not change, but you will see the response from the replacement script.

If you bring your B game, you'll spend hours trying to work-out WTF is going on...!

GH
0
Sheldon LivingstonConsultantAuthor Commented:
I just realized that I have another website on the same server, my server, that has the same redirect code that works for all browsers.

Thus, I now think the issue might be a server configuration as it relates to the web site.
0
G_HCommented:
Try a service like http://web-sniffer.net/ to see if the headers are exactly as you expect (on both sites).

If they are different, then you may well be right.

GH
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.