Redirect based on user agent

DamnedFreak

Junior Member
Joined
Feb 12, 2010
Messages
129
Reaction score
15
All,

I would need a script that does a redirect of the visitor to another site, depending on which user agent is provided.

The background of it is that I want the google bot to see a different site than the one the users sees.

Regards,
Steve
 
Code:
<?php

$agent = $_SERVER['HTTP_USER_AGENT'];

if (eregi("google", $agent))
{
    Header( "Location: " . "http://cloaked.com" );
} else {
    Header( "Location: " . "http://acaimonies.com" );
}

?>
 
Be careful with that... google routinely visits the site from another non google to catch cloakers... its an automatic forever ban.... also they routinely request a weird page like htkjajaljkjklfjfjfkjakjklfda.htm to see if you give them a page for that... if its not a 404 error auto ban.... they are doing everything to catch you..
 
Thanks to both of you for enlightening me.
Seems I should read a bit more on cloaking and what Google already does about it.

My thought was to rank a site based on Wordpress for a keyword, and redirect the traffic directly to a CPA offer once I'm ranking, yet still wanted Google to see and crawl my WP page.

Cheers,
Steve
 
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock