How can I find the URL of a redirect?
I'm taking over hosting of domain that simply redirects to its online booking page of a third party provider.
Because the landing page is http://example.com/generic/booking.asp I'd like to know how to find a way to trace the URL of the http redirect.
I don't have access to the existing sites .htaccess
Is this done server side and the only thing the client sees is the new address to go to?
Solution 1:
Simply use
wget <url>
and see the output. For example if you use
wget students.iiit.ac.in/~sysadmin/
you will see output
--2009-06-02 10:00:24-- http://students.iiit.ac.in/~sysadmin
Resolving students.iiit.ac.in... 192.168.36.200
Connecting to students.iiit.ac.in|192.168.36.200|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://web.iiit.ac.in/~sysadmin [following]
--2009-06-02 10:00:24-- http://web.iiit.ac.in/~sysadmin
Resolving web.iiit.ac.in... 192.168.36.158
Connecting to web.iiit.ac.in|192.168.36.158|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://web.iiit.ac.in/~sysadmin/ [following]
--2009-06-02 10:00:24-- http://web.iiit.ac.in/~sysadmin/
Connecting to web.iiit.ac.in|192.168.36.158|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3377 (3.3K) [text/html]
Saving to: `index.html'
As you can see the in Location: header the page redirects to web.iiit.ac.in/~sysadmin. After this also check contents of index.html. If they content HTTP META refresh tag like
<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://research.iiit.ac.in/~saurabh.barjatiya">
</head>
<body>
</body>
</html>
Then the web.iiit.ac.in/~sysadmin page will redirect to research.iiit.ac.in/~saurabh.barjatiya.
These are the two most common ways of redirecting used by people. The website you are interested in most probably uses one of the above two methods or combination of both.
Solution 2:
curl -I http://example.com/generic/booking.asp
Look at the Location:
header in the response
Solution 3:
The easiest way is to use the redirection tracing tool at http://redirectdetective.com/
Solution 4:
Ever use Fiddler? It may be able to capture the redirect.
http://www.fiddler2.com/fiddler2/
Solution 5:
Either on the domain hosting site that does the forwarding,
Or the script in the index or home page that redirects the traffic to the landing page.
Hope that helps.