Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^.*google.* [NC]
RewriteRule /theforbiddendirectory/(.*) - [F]
Would this work, and do i need to include the full directory path from the root of the server, or the root from the site itself?
Full directory path :
/var/www/vhosts/mysites.com/httpdocs/forbiddendirectory
or :
/forbiddendir
I need to have this 100% correct, i only want to restrict google from 1 directory, not the whole site...
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} googlebot [NC]
RewriteRule ^/theforbiddendirectory/ - [F]
Then install and test your code. Wannabrowser is handy for a quick test run pretending you're Googlebot.
I presume that you have already told google not to spider this directory path by using robots.txt...
Jim