i've implemented a Single Sign On feature which redirects the user to another domain and back again. Naturally, I don't want search engines (the ones we care about at least) to be redirected, so what's an acceptable solution?
Here's one I found in PHP
$agent = strtolower($_SERVER['HTTP_USER_AGENT']);
if (strpos($agent, "bot") ||
strpos($agent, "slurp") ||
strpos($agent, "crawl") ||
strpos($agent, "google") ||
strpos($agent, "teoma") ||
strpos($agent, "spider") ||
strpos($agent, "feed") ||
strpos($agent, "index")) {
return null;
}
Maybe the best solution would actually be to detect and only redirect real users ?