Apache

ID #175

How do I deny web access to a particular file?

Applies to: Grid System

If you have a file underneath your DocumentRoot (accessible to a browser) that you do not want anyone to be able to view in a browser, you can block access to it with a Files directive in an .htaccess file. The .htaccess file will affect all subdirectories below the one in which the .htaccess file resides.

For example:

<Files ~ "^somefile\.ext">
Order allow,deny
Deny from all
</Files>

will deny access to any file that looks like "somefile.ext".

Please see the Apache documentation on the Files directive here.


Last update: 2011-07-11 17:15
Author: FAQ Admin
Revision: 1.2

Digg it! Share on Facebook Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 0 (0 Votes)

completely useless 1 2 3 4 5 most valuable

You can comment this FAQ