4

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?

8 Answers 8

4

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.

1
  • Yep - that's what Fiddler does as well only in a GUI.
    – Rob Bergin
    Jun 2, 2009 at 17:14
2
curl -I http://example.com/generic/booking.asp

Look at the Location: header in the response

2

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

1

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

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

1

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.

1

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]
1

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!

0

You can use some web based tool like https://redirectinspector.com or similar.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .