strpos or strstr would be a lot faster than preg_match:
Code:
if( strpos( $_SERVER['HTTP_USER_AGENT'], "Googlebot" ) !== false ) {
// we've found a googlebot
}else{
// session initialization code
}
More Information:
- 2 posts - 2 authors - Last post: Jan 5, 2008global $user; if ($user->data['user_id'] == ANONYMOUS OR $user->data['is_bot'] ) { $session_id = false; } // End SEO phpBB
- 4 posts - 4 authors - Last post: Jul 23If I might add one suggestion: could you remove 'Session manager saved sessions'
- For instance, if a ? indicates a session ID, you may want to exclude all URLs that contain them to ensure Googlebot doesn't crawl duplicate pages
- I have searched for googlebot 404 from java and all the fixes are directed at inline scripts with urls in them
- */ unset($_SESSION['username']); /* Demonstrate that session variable is indeed gone
- Crawl: Googlebot can extract frame/iframe URLs discovered at crawl time
Bookmarks