How to detect URLs that are being redirected?

Discussion in 'Programming' started by JGK, Jun 27, 2012.

  1. #1
    So, let's say I'm on a website that has outbound links on it. Those links actually point to a file on the site (example.com/outbound/123) and that URL redirects to something else (an affiliate link) which redirects to a final link at the commercial website. I'm trying to figure out how to detect the URLs on each step of the way, so that I can uncover the affiliate link that is hidden in the middle step (to know what affiliate network is being used). How can I do this? Thanks.
     
    JGK, Jun 27, 2012 IP
  2. Kaminski

    Kaminski Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    parse for header informations ... like 302, 200, 404 etc. ....

    which language do you will use? ... PHP, C#? ...
     
    Kaminski, Jun 28, 2012 IP
  3. a9entropy

    a9entropy Member

    Messages:
    31
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #3
    I think you can make a HEAD request.
     
    a9entropy, Jun 29, 2012 IP
  4. xrvel

    xrvel Notable Member

    Messages:
    918
    Likes Received:
    30
    Best Answers:
    2
    Trophy Points:
    225
    #4
    Most of redirects use HTTP header. That can be detected by reading the HTTP header response of the URL.
    But some redirect use meta tag and even javascript. These methods should be detected by reading the body response of the URL.
     
    xrvel, Jul 2, 2012 IP