Since this does appear to be the real Googlebot, the recommended way to block access/crawling is to use /robots.txt
:
User-agent: googlebot
Disallow: /blocked.php
However, if you still want to block this IP using .htaccess
then you can do something like the following, near the top of your root .htaccess
file:
RewriteEngine On
RewriteCond %{REMOTE_ADDR} =66.249.79.70
RewriteRule ^blocked\.php - [F]
This will return a "403 Forbidden" when a user with the above IP address attempts to access /blocked.php
. Note that the "user/bot" still tries to access the URL by making a request, whereas with robots.txt
they shouldn't even make the request (assuming they obey the robots.txt "standard"; which Googlebot does).
However, bear in mind that Googlebot can crawl from different IP addresses, so this may need to be updated in the future.
If you did want to block the range of IP addresses denoted by 66.249.79.xxx
, then you could change the above condition to:
RewriteCond %{REMOTE_ADDR} ^66\.249\.79\.
However, that could block more than just Googlebot and may not be any more successful at blocking Googlebot than checking the specific IP address above (Googlebot does not necessarily crawl on a continuous IP block).