Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Block User Agent From Root and Sub-directories



8:19 pm on Feb 9, 2010 (gmt 0)

10+ Year Member

RewriteEngine on
RewriteCond %{HTTP_user_agent} libwww-perl [NC]
RewriteRule ^ - [F]

I am trying to use this from an old post by jdMorgan [webmasterworld.com...]

The result on my site is that it blocks access only to files in my root directory /public_html. Sub-directories are unaffected.

I have changed the user agent on my site to WebDataCentre and am testing with FireFox and the User Agent Switcher.

I am wondering if the problem lies in the way Apache is configured in my setup.


11:44 pm on Feb 9, 2010 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Try adding "RewriteOptions inherit" to any subdirectories which have their own .htaccess files.

If that's not applicable or doesn't help, then disable MultiViews and, on APache 2.0 or higher, disable AcceptPathInfo if you don't use these features.



1:23 am on Feb 10, 2010 (gmt 0)

10+ Year Member

RewriteOptions inherit
This seems to be the ticket. Thanks so much.

Featured Threads

Hot Threads This Week

Hot Threads This Month