Web Directory Protection
Users and Groups > Step 2: Directory Access Rules
Create directory access rules
Access rules for a directory are set in a file called .htaccess, and apply to all sub-directories and files in the directory.
The file should look something like this:
require valid-user
To create the rule file, do the following:
- Open up a plain-text editor (i.e. Notepad).
- Enter one of the following rules:
require valid-user
permit access to all users in the htusers filerequire user "USERNAME"
permit access to the user "USERNAME" (i.e. joe) onlyrequire group "GROUPNAME"
permit access to all users in the group "GROUPNAME" (i.e. bruins)
- Save the file as ".htaccess" (include the period and the quotation marks).
Configure CuteFTP to display hidden files
On the BOL FTP server, filenames beginning with a period (such as .htaccess) indicate that the file should be hidden. CuteFTP does not display hidden files by default, so you'll need to change that by doing the following:
- Open the Site Manager.
- Click the open book icon (first on the left by default) on the toolbar, or
- Go to Tools menu > Site Manager > Display Site Manager
- If you haven’t already, create a connection to your BOL FTP site.
- In the Site Manager, select the site from the list on the left.
- Select the Actions tab and click the Filter... button.
- In the Filter window, check the boxes for Enable filtering and Enable server side filtering (server applies filters).
- In the Remote filter: field, enter -a (dash ‘a’) and click the OK button.
- Click the Connect button to connect to your BOL FTP site.
Upload the file
Upload .htaccess to the folder you want to protect.
- Connect to your BOL FTP site.
- Navigate to the folder you want to protect. (public_html, if you want to protect your entire website)
- Upload .htaccess.
Note: If .htaccess "disappears" after uploading, see Configure CuteFTP above.
