Redalto Communications Support Site

Question: Protecting A Folder Using Htaccess File

This question relates to the following categories: Business Hosting, Web Hosting

Answer:

First create two files called .htaccess and .htpasswd

Now open .htaccess and paste in this code

AuthName "Restricted Area"
AuthType Basic
AuthUserFile YOURDOMAINPATH
require valid-user

now the only thing you will need to change is the domain path which you can find via your redalto control panel (http://clients.redalto.com)

now save the file and uploaded it into the directory you wish to protect, in my case I want to protect the entire site so I place the .htaccess file into the www folder.

Once that is done we have to set up users, so open up the .htpasswd and goto Redalto htpass Generator and put in your username and password. Once this is done copy the line of text containing your username and some random characters (for example: redalto:7bOOUmQBZbYvo) into the htpasswd file.

*Note if you want more than one username simply repeat the previous step but paste each username on a new line in the .htpasswd file
(for example:
redalto:7bOOUmQBZbYvo
communications:77PhDNQya6yvU

once you had completed this upload it into the root directory of your ftp account.

Now once try and open up a file in the directory we place the htaccess file in and you will be prompted for a password as it is now a protected folder.

Print this Email

  • Author: Redalto Support Team
  • Created on: 13 Nov 2007
  • Views: 664
  • Last modified: 04 Feb 2008

Can’t Find the Answer You’re Looking For?

If you’ve searched our FAQ database and still can’t find the answer, please submit your question using the below form. We will contact you as soon as possible, and if necessary update the FAQ with the missing information.