Hello,

I'm stuck on this and I think it should be something simple. But here's the issue. I want to display all the url redirects for a given url.

For example:

url one: http://domainone.com

which when clicked goes to: http://trackingdomain.com

which then goes to: http://trackingdomain2.com

which then ends up on: http://finaldomain.com

I need to be able to input the first url then have it display all the others. I thought curl and php could do it with the get_info command on the headers but it didn't work.

Any suggestions?

    Im not quite sure i understand what your tryin to do. When someone clicks the link you want them to go to one page, then immediately forwarded to another page, then forwarded to another, and then finally send to the last one? all within a few seconds? or what?

      Just to clarify, I do not know the urls of anything besides the first one that input into the script.

      I'm trying to write a script that shows me the url hops for a given link. (again I only know the first url, I don't know the others but I want the script to tell me what they are.)

        I guess you could probably just create a session and concat the pages name to it in each page. Otherwise if your using headers to forward then i don't think theres anyway to identify all the past urls that were relayed from.

          Hmm, here's where i'm stuck. I'm not doing any of the redirecting, it's not my link. I only know the first link, (it's from a banner ad), but I want to see which ad network they're with, so I'm trying to figure out how to see all the redirects it takes.

            Sounds like you could use cURL with the CURLOPT_FOLLOWLOCATION option set to 0 and CURLOPT_HEADER set to 1 (and CURLOPT_NOBODY set to 1, since you don't really care about the contents of the page(s)), and then parse the 'Location:' header (if one is present). If it is present, store it in an array and then follow that URL... repeating this process until you reach the final page.

              Write a Reply...