|
Well in php, $_SERVER['REMOTE_ADDR'] is the variable for the visitor's IP
You could basically do at the top of a page
$ip = $_SERVER['REMOTE_ADDR'];
if ( $ip not an allowed ip ) {
header('Location: {uri to plain text optimized page}');
exit;
}
how you want to say that the ip is not an allowed ip is up to you
you might also want to make use of the $_SERVER['HTTP_USER_AGENT'] variable, which gives you the user agent string (i.e. Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) ) which tells you what kind of browser they're using.
Regular search engine bots use they're own user agents, but mischevious bots created by people generally fake user agents, so that's something to consider.
Also, any of the stuff you can accomplish in htaccess over scripting, I would suggest doing that first. It would be less load on the CPU to be handled by htaccess over a script. So use htaccess to do the filtering and then PHP to catch the rest.
__________________
Nobody doing nothing
|