
Originally Posted by
ata.online
To protect files in /public_html can i just chmod files? Would that not be enough?
You want the scripts to be able to read the files but not a visitor. Permissions won't help because the web server runs the scripts and processes the visitor's request; both scripts and visitors are accessing the files with the same credentials.
I still say the best (i.e. safest & easiest) solution is to put adb_feeds in ~. There's a reason the script you're using expects to find them there. I don't see why you want to put it in public_html.
As for using mod_access, the linked document gives you the necessary information (in particular, the Order directive), but it takes a little reading and thinking. Here's the give-you-a-fish version; in adb_feeds/.htaccess, put
Code:
Order Allow,Deny
Deny from all
Options -Indexes
The last line is to turn off autoindexing.
As an alternative to mod_access, you can use the rewrite engine (see also the rewrite guide, in particular the access restriction section). In ~/public_html/.htaccess, put:
Code:
RewriteEngine on
RewriteRule ^/?(adb_feeds|cache) - [F]
One advantage of RewriteRule is you can use a single line to deny access to multiple directories.
Another alternative is to use RedirectMatch. In ~/public_html/.htaccess, put:
Code:
RedirectMatch 404 ^/(abs_feeds|cache)
Like RewriteRule, you can match multiple directories. Additionally, this will leak even less information, as the visitor gets a "Not Found" response rather than "Forbidden" (which lets them know that the URL exists, but is inaccessible through normal means). It's functionally equivalent from a security standpoint to having adb_feeds in ~, though I'll repeat: just sticking adb_feeds in ~ is easiest of all.