Deny Access to Any Files

posted: Monday 23 November 2009 by Tavis J. Hampton in: Web Hosting Web servers

403 forbidden error, access denied

Question: I have a set of files on my website with the extension .rpc. They are financial files, and I want to make sure that no one can access them from the web. Can i do that?

Answer: On an Apache server, you can do just about anything, and .htaccess files make a lot of that possible. Simply create an .htaccess file or use the one you already have and add something like this:

<Files ~ "^.*.([Rr][Pp][Cc])">
Order allow,deny
Deny from all
Satisfy All
</Files>

The letters are repeated in lowercase and capital to ensure both are blocked. Simply substitute the letters with whatever extension you want to deny. For example: <Files ~ "^.*.([Ll][Oo][Gg])"> will deny access to all .log files. It really is that simple.

1 stelle2 stelle3 stelle4 stelle5 stelle (no votes)
share this 0 comments

Related posts

Server Hardware Tips del 28 Jul 2010
Server Maintenance Tips del 28 Jul 2010
Server Hosting Tips del 27 Jul 2010
Server Domain Tips del 27 Jul 2010

Related tags

Be the first to add a comment to this article.

Your email address is required but won't be displayed.
Leave a comment

Register to reserve your nickname accross all the blogs in the Blogo network and to upload your avatar. If you already are registered, login to user your nickname.

Yes No

Comment preview

Network Blogo