How can I know if google spiders or another spiders visit my page ?
<?php
if ("this is a spider") {
header('Location: index.php');
exit;
}
?>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can look for the value of global variable: $_SERVER[‘HTTP_USER_AGENT’] . For google spider, the value will look like “Googlebot*”
PHP’s get_browser function is also useful (check if the returned browser type is known or not- if not then most likely spider or crawler).