hi
is there any way I can detect a webcrawler/spider hit like "googlebot" on my index.php page?
is there a certain property or sign that only a spider has that PHP can detect to conclude and be sure a certain page request is a spider?
thanks
sorry if my english sucks
spoting spiders/crawlers
Moderator: General Moderators
- SystemWisdom
- Forum Commoner
- Posts: 69
- Joined: Sat Mar 26, 2005 5:54 pm
- Location: A Canadian South of the 49th Parallel
Well, all spiders/bots have a user-agent signature (as far as I know), and I think googles contains something like: Mediapartners-Google, so maybe something like this will work for you?
Code: Select all
if( stripos( $_SERVER['HTTP_USER_AGENT'], 'Mediapartners-Google' ) !== false )
{
// Do stuff..
}