Allow certain IP ranges and googlebot, deny the rest, for certain URLs only

Viewed 32

I need to modify and combine some .htaccess rules, in order to meet 3 separate conditions:

  • Allow access from certain IP ranges, deny the rest
  • Allow googlebot, no matter what IP
  • All this applies only to any URL containing 'theword'
<Directory "containing *theword*">
   Order allow,deny
   Deny from all
   Allow from 192.168.0.2
   Allow from 10.0.0.1
</Directory>
<Files "containing *theword*">
   Order allow,deny
   Deny from all
   Allow from 192.168.0.2
   Allow from 10.0.0.1
</Files>

I need help formatting rule with the files/directories containing theword and add exception for the googlebot.

0 Answers
Related