Page 1 of 1

Dodgy referral links - can they be stopped?

Posted: Fri Jun 20, 2014 4:27 am
by simonmlewis
We run a site that has tens of thousands of links from "Google hated" web sites.
I know how to 301 a page to another page, but how do we identify the URL it's come from - and say "if the referral URL is 'x', then take the link to 'b'".

Can this be done in PHP or htaccess?

Re: Dodgy referral links - can they be stopped?

Posted: Fri Jun 20, 2014 6:45 am
by Celauran
Sort of. You can use the HTTP_REFERER header to try and detect it, but it can be spoofed and so shouldn't be considered reliable.

Re: Dodgy referral links - can they be stopped?

Posted: Fri Jun 20, 2014 6:49 am
by simonmlewis
Ta - I have tried that and it does work. But as you say, it can be spoofed.

I've since been told that even tho it's being pointed elsewhere on the site, it's still COMING to the site - so needs to be dealt with directly thru google.