Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

7 Answers 7

up vote 3 down vote accepted

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.

share|improve this answer
    
Yep - that's what Fiddler does as well only in a GUI. –  Rob Bergin Jun 2 '09 at 17:14

The easiest way is to use the redirection tracing tool at http://redirectdetective.com/

share|improve this answer

Ever use Fiddler? It may be able to capture the redirect.

http://www.fiddler2.com/fiddler2/

share|improve this answer

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.

share|improve this answer

Telnet to port 80 on that machine, and pretend to be a web browser:

$ telnet example.com 80
connected

GET /generic/booking.asp HTTP/1.1
Host: example.com
[enter]
[enter]
share|improve this answer

It depends a little on how it's doing the redirect. The normal way is for it to send something like an HTTP 302 page to the browser, containing the URL to go to.

If that's the case, then you just need to pretend to be a browser using something like the telnet example above and it'll tell you the URL.

Another way is to just go to the page in a normal browser and see where you end up!

share|improve this answer
curl -I http://example.com/generic/booking.asp

Look at the Location: header in the response

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.