1

I have a scenario where i want to find all the urls involved in a redirection. for example i have a url let says track.domain.com/123 Now if you click this urls it will redirect to domain1.com/123 then domain2.com/345 and so on. This direction can be either 301 or 302.

So i want to find how each url involved in the redirection. The output should be like.

track.domain/123
domain1.com/123
domain2.com/345

I tried with the Curl but it only gives me the first url itself.

user2782183
  • 33
  • 1
  • 1
  • 4
  • i think this is what you want to [achieve](https://stackoverflow.com/questions/3519939/how-can-i-find-where-i-will-be-redirected-using-curl) – strator Nov 30 '19 at 13:59
  • @strator yes, but i only gives me the final url. I want all the urls being used in the redirection. – user2782183 Dec 03 '19 at 06:02
  • You'd need to create a loop to follow the location. Ie if the response http status code == 301 or 302, log it, then call curl again with the new location given. Example here: https://stackoverflow.com/a/3233549/5980481 – David Dec 03 '19 at 08:30

0 Answers0