SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Hybrid View
-
Apr 23, 2007, 09:45 #1
- Join Date
- Feb 2006
- Location
- Altoona, PA. USA
- Posts
- 1,945
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
$_SERVER['HTTP_REFERER'] not working in conjunction with 301 re-route
I have this in place on every page to track where users found us from:
PHP Code:if(!isset($_SESSION['referal'])){
$web_referal = $_SERVER['HTTP_REFERER'];
$web_referal = parse_url($web_referal);
if($web_referal['host'] != 'www.kranichs.com'){
$_SESSION['referal'] = $web_referal['scheme'].'://'.$web_referal['host'].$web_referal['path'].'?'.$web_referal['query'];
}
if($_GET['tracking']){
$_SESSION['tracking'] = $_GET['tracking'];
}else{
$_SESSION['tracking'] = 'none';
}
}
for instance:
if they go from google strait to page A and page A has a 301-re-route to page B....then the referal information gets lost.
I believe because page A is refered from google but never gets a change to run the code and gets directly re-routed to page B and then when page B runs the code it wasnt refered from google it was adjusted in the server...
Does anyone know how I can fix this?
THANKS!
-
Apr 23, 2007, 12:22 #2
you shouldn't rely on HTTP_REFERER I can disable referrer logging in my browser, try QUERY_STRING
my mobile portal
ghiris.ro
Bookmarks