How to restrict access to a web site folder
Sunday, August 12th, 2007Have you ever wanted to control access to a directory or file on your website?
Well, it’s actually quite simple to do this using an “.htaccess” file placed in that very directory of your website.
Currently this only works for Unix/Linux/Apache based hosts.
If you’re hosting your site with a a hosting company and you have a control panel to manage your site, you most likely have a more automated method for doing this. This article will explain how to do it manually, mainly for people with ‘root’ access to the server.
So what is this .htaccess file?
A description of an .htaccess file as stated on the Apache website is
.htaccessfiles (or “distributed configuration files”) provide a way to make configuration changes on a per-directory basis.
Basically it allows you to make configuration changes to the functionality of the web server, but on a per directory basis.
OK, lets do this already.
First, login via SSH to the server hosting your website.
Change to the directory that you would like to restrict access to, or create it if it does not already exist.
(more…)
