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 TextEdit.
- If you see the formatting toolbar (Styles, Spacing, Lists, etc.) on the editor window, select Format menu > Make Plain Text.
- 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). Note: You may need to uncheck the box for If no extesion is provided, use ".txt".
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:
- Go to CuteFTP Mac menu > Preferences.
- Select Display from the list on the left.
- Check the box for Show remote hidden files and folders and click the OK button.
- Open the Site Manager.
- Click the book icon (first on the left by default) on the toolbar,
- Go to File menu > Site Manager, or
- 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 and click the Edit button.
- In the Site Properties window, check the box for Show hidden files and folders 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.
