NYCPHP Meetup

NYPHP.org

[nycphp-talk] Htaccess question for blocking directories

Cliff Hirsch cliff at pinestream.com
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 http://lwww.domainnam.com 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.
issues?

Cliff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20070820/3eaa3ed7/attachment.html>


More information about the talk mailing list