[nycphp-talk] Htaccess question for blocking directories

Cliff Hirsch cliff at
Mon Aug 20 11:29:28 EDT 2007

I have been researching various method for blocking directories and dir
listings. Many versions seem to be implemented poorly or just overkill,
using fancy rewrites and performance killing regex for everything.

Can anyone tell me if there are any issues with my solution:

1. Use ³Deny from all² for the dir to be protected. In local .htaccess or
higher level .htaccess for better performance.
2. Place ErrorDocument 403 in a root-level (or
other appropriate level) .htaccess file.

No need for Rewrites, Rewritematches, index.php files in every folder, etc.

This blocks the directory while taking care of the ugly 403 message. A
redirect to the home page seems reasonable. But are there any SEO, etc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the talk mailing list