Dynadot

Detecting URLs while being redirected

Spaceship Spaceship
Watch

JGK

Established Member
Impact
18
Hey there,

This is more along the lines of sorting through something that another person has coded, but it seems like this would be the best fit forum-wise.

So, imagine I'm visiting website that has outgoing affiliate links on it. Those links are actually formatted to point to the site itself (example.com/out/123), but those URLS then redirect to the affiliate link (myaffiliate/offers/123). After that, the affiliate link redirects to the final address (buymystuff.com).

Normally, this process goes at a fast enough speed that you can't find out the middle URL (the affiliate one). I'm trying to understand how you can detect URLs at every step in this process, to be able to figure out the affiliate link being used, and therefore the network that is involved in this offer.

How can I accomplish this? Thanks for the input. :)
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
get the 'live http headers' plugin for firefox.
 
0
•••
Or using curl from the linux command line

Code:
curl --head http://example.com/out/123

The headers should return 301 or 302 HTTP code
The location header indicates the URL to follow.

NB: there could be more than one redirect.
Try again with the URL returned until you reach the final destination.

The Opera browser also has an option to disable automatic redirection.
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back