I'm wondering if there is a method to global sniff for browser requests to present them a "site shut down" page while at the same time allowing spiders free reign so maybe I can get a few more months of pulling up my buddys from below.
#!/usr/local/bin/perl
$agent = $ENV{'HTTP_USER_AGENT'};
@robot = ("googlebot","scooter","gulliver"); # Robots Party List
foreach $allow (@robot) {
if (lc($agent) =~ /$allow/) {
$allow = 1;
}
}
if ($allow == 1) {
print "Pragma: no-cache\n";
print "Location: [send_spiders_here.com\n\n";...]
}
else {
print "Pragma: no-cache\n";
print "Location: [send_browsers_here.com\n\n";...]
}
exit;
Here's something I threw together which you could use to replace the index page. It's not global though. That would have to do be done through .htaccess, if I understand your question correctly.
SetEnvIf User-Agent "googlebot" googlebot=1
Order Allow,Deny
Allow from [google class C here]
Allow from [another google class C here]
Allow from env=googlebot
That will work, you could use truncated IPs to work with class Cs like this:
Allow from 222.111.222
You know they are reading this right?