URL 301 based on refer domain

420friendly

Regular Member
Joined
Nov 12, 2009
Messages
249
Reaction score
68
Is there a way to 301 to a domain based on where the link comes from.?

Example: domain is 301 forwarded to someurl.com however if the link is from CNN I want it to show the 301 to adifferentdomain.com

Is this possible via .htaccess
 
you can do that using php not sure using .htaccess
 
The only way I can think of this would be, redirecting the pages that were linked to. But if all links are on one page then I don't think you can redirect link juice to two places.
 
Yeah they are to the homepage... I am still reading the apache forums... grrrrr there has got to be a way!
 
It has been a long time since I moved to nginx, but something like this should do the trick:

edit: I cannot post the code as it's being detected as spam... check pastebin 4Rf7zYcE
 
Back
Top