homepage Welcome to WebmasterWorld Guest from 50.17.27.205
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Block User Agent From Root and Sub-directories
bumpaw




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

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.

 

jdMorgan




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

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.

Jim

bumpaw




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

RewriteOptions inherit
This seems to be the ticket. Thanks so much.
Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved