Apache: How to deny access to a folder or file?

Add the following list of lines into .htaccess file or to vhost configuration file appropriate to the folder within the website

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

Same will be the case for denying files within directories

<Files ~ “\.ini$”>
Order allow,deny
Deny from all
</Files>

The above lines of code will be helpful for us to prevent .svn files, .ini files, .htaccess files, include files from display within Apache

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Written by kurinchilamp


Website: http://

Leave a Reply

Your email address will not be published. Required fields are marked *

Read previous post:
SQL Injection: Whitelist validation vs. blacklist validation

Whitelist validation refers to data validation techniques such as checking the data type, data length, input range, nature of data...

Close