PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Dec 19, 2018 10:58 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Jun 20, 2014 4:27 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4426
Location: United Kingdom
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?

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Fri Jun 20, 2014 6:45 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6424
Location: Montreal, Canada
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.


Top
 Profile  
 
PostPosted: Fri Jun 20, 2014 6:49 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4426
Location: United Kingdom
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.

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group