PDA

View Full Version : Protecting cache folder agains bad code injections?


postcd
03-11-2014, 10:47 AM
What re ways to protect 777 cache folder agains malicious files and code injection into files?

Is there any handy htaccess which prevent loading of malicious code? I know i found some topic about this, but cant find it.

fxdigi-cash
03-14-2014, 11:17 AM
it should be very simple. all you have to do is to use .htaccess rules if you use Apache to prevent anyone from going there!!

if you want to allow all visitors, use this:

<Directory />
Order Deny,Allow
Allow from all
</Directory>

if you want to deny all, but allow only your local address 127.0.0.1, use this

<Directory />
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>

if you want to deny all, use this:

<Directory />
Order Deny,Allow
Deny from all
</Directory>

if you want to setup a password and username protection, that is different story:

Order deny,allow
Deny from all
AuthName "Restricted Area - Authorization Required"
AuthUserFile /your/file/path/.htpasswd
AuthType Basic
Require valid-user