CGI, Perl (6)
Control Panel (5)
Domain Registration & DNS (11)
E-Mail Services (4)
MySQL (2)
PayPal IPN & Testing (17)
SSH and Misc. (1)
Web and Files (9)
 File Management (2)
 IPN Subscription Manager (5)


Search


Web and Files:Secure Folder using .htaccess

    Adding a secure folder to your web site is pretty simple. There are two ways you can go about this.

1) You can use your Control Panel to secure a folder, this will also let you add/delete users manually.
Login to your control panel at http://www.belahost.com:2082   
Select from the panel under site management Web Protect.
Click on the Folder Name to configure a folder for Protection, Click on a Folder Name to open that folder.
When you click on the folder name you will be asked a few questions, click save and your folder is now protected.

2) You can manually add the folder protection files first you need to create a ".htaccess" file exactly as typed. Put this file in the folder that you wish to protect.  In this file should display the following:

AuthType Basic
AuthName "Members Area"
AuthUserFile "/home/YouUserName/PATH TO /.passwd"
require valid-user

Here is a full example:
AuthType Basic
AuthName "Members Area"
AuthUserFile "/home/xxxxxxxx/public_html/members/.passwd"
require valid-user

=========================

Save the file and set permissions of 644. Now you need to create a empty password file with write permissions.

Create a .passwd (name does not matter make sure . is before the name to make it hidden)
save the empty file with permissions of 777 (you can press enter once to add 1 line to the file)


 



Was this faq useful?
Yes No
Copyright © 2002 - 2007 BelaHost.com. All rights reserved.Terms Of Service | Contact us/Get a quote