Forum Moderators: phranque

Message Too Old, No Replies

too many redirections

         

httpwebwitch

3:00 am on Nov 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am A

I have a link on my site that goes to B

B redirects to C
C redirects to D
D redirects to E...

I'm really not sure how long the chain is, but eventually it gets to little cat Z, then VOOOOOM!
I hope you enjoy the Dr Seuss reference

Anyways, in that long chain of redirection, I'm "A".

Now, when I link directly to B, my request gets to Z and Voooom.

I don't want to link directly to B. I want to perform some server-side logging and tracking first, then send the user to B.

But if I request a script which then redirects to B, I'm stopped at some other page, presumably one of the interim little cats, I do not get to Z, and no Voom.

I know there's a limit (in HTTP 1.0) of 5 redirections... but no limit in HTTP 1.1. Is that what's going on here? I can think of no other explanation!

In all my years working with HTTP I've never actually encountered the redirection limit. Infinite redirection loops, sure, but those were bugs I fixed. I knew a limit existed, but always thought it was stratospheric and therefore hypothetical

How can I get around this? Is there anything, anything, anything I can do? Do I need to get out Thing One and Thing Two?

phranque

8:25 am on Nov 24, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



have you tried a different browser?
i believe you can view/edit this in firefox thusly:
go to url about:config and look for network.http.redirection-limit

httpwebwitch

5:39 pm on Nov 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



eureka. the most suspicious ingredient (lots of redirections) was not the problem ingredient (URL being improperly urlencoded, which didn't become apparent until part-way down the chain of redirections).

Turns out that the querystring in my URL worked fine for A->B->C->D-> ... then got clogged when it hit E. I fixed the urlencoding, and now it flows through E no problem, all the way to little cat Z with the Vooom in his hat.

Though exploring this did show me some nuances of HTTP and browsers I hadn't explored before.
thanks phranque