Welcome to WebmasterWorld Guest from 107.20.104.161

Forum Moderators: open

Message Too Old, No Replies

Read a 302 Referer - is it possible?

     

internetheaven

5:01 pm on May 4, 2013 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've got traffic being 302'd to my site. All I get to see is the original page the click started at.

Is there a way (java/php) to read the URl of the 302?

e.g.

URl 1: http://www.example.com/folder/page.php

a href links to

URl 2: http://www.othersite.com/redirect.php

which 302 redirects to

URl 3: http://www.mysite.com/


I only know how to find out what URl 1 is using coding on my own site (http referer). How do I find out what URl 2 is? Currently, nothing I do tells me.

lucy24

7:26 pm on May 4, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Double-check: Do sites 1 and 2 belong to you? The question seems to imply they don't-- except in that case how would you know it's a 302 rather than a 301?

Are you looking for an answer that's constrained to information available at mysite.com, regardless of whether you have access to the first two?

internetheaven

11:16 am on May 6, 2013 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's right, I don't own URl 1 or 2.

I can only use mysite.com to determine where traffic is coming from.

daveVk

1:01 pm on May 6, 2013 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



As it is the server receiving the request, unless you running JavaScript server side, this is the wrong forum. In PHP (say) you should be able to see all headers, maybe there is something useful there, I do not know.

lucy24

9:29 pm on May 6, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



The underlying problem is that all the servers involved are doing exactly what servers are supposed to do: retain the original referer when a request is redirected along the way.

How many different redirects are involved? If it's only a few and you just need the information once, it may be simpler to borrow your brother's computer, go to the originally referring URL and see what they link to. Not too useful of course if it's a directory with hundreds of links.

That's assuming you're talking about an ordinary redirect, rather than a proxy. If it is a proxy, you may get some useful information from the "X-Forwarded-For" header. It won't come through in logs but you can pick it up via php. Or, if you simply want them to stay the ### away, you can use mod_rewrite or mod_setenvif (or, er, equivalent in That Other Server) to check the header and take action.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month