View Full Version : redirecting useres from specific referrers
a!!!!1
Dec 9th 2008, 11:06 am
I'm sending traffic to a .php on my server, and I want to redirect all users who come from 'google' to a specific url, and all else are redirected to another url. How do I do this? Thanks :)
GreatMetro
Dec 9th 2008, 11:43 am
use the HTTP var to check the referrer, and then the header() function
a!!!!1
Dec 9th 2008, 12:03 pm
Thanks but I barely understand PHP so writing it myself is a little hard, lol.
firman01
Dec 9th 2008, 7:40 pm
<?php
$ref = = $_SERVER['HTTP_REFERER'];
if(strstr($ref,"google")) {
header("Location: http://www.peoplefromgooglegohere.com/");
} else {
header("Location: http://www.otherpeoplegohere.com/");
}
?>
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.