To password protect a folder in your webspace, follow these steps:
Please note: these specific instructions can only be used within your standard homepages webspace.
Open your text editor (Notepad will do for Windows users, OS X users can use TextEdit) and paste in the following block of text.
AuthUserFile /share/isp/plusnet/www/uu/username/htdocs/path/.htpasswd
AuthName "Please Log On"
AuthType Basic
require valid-user
Save the text file as htaccess.txt - we'll rename it later.
Go to the htpasswd manager on our Usertools site.
You'll now see a box that shows each username you entered, followed by an encrypted version of their passwords.
It'll look something like this:
andrew:lklt1SXOoPlQ2
Copy & Paste this into a new file in your text editor and save it as htpasswd.txt
Connect to your webspace and go to the folder you want to password protect, and upload both files.
Use your FTP program to CHMOD htaccess.txt to 744 (File Owner: read, write & execute, group & public: read only).
CHMODing the files offers security by preventing other users from altering your files.
The final step is to rename the two files as follows - note the leading full stop:
The files will disappear the next time you refresh, if you need to edit or remove them you'll need to use an FTP program that allows you to see hidden files such as FileZilla. If you're not sure how to do this, there's a step-by step guide here.
That's it! If it's worked, you'll be asked for a username and password the next time you browse to the protected folder.
Popularity: 4% [?]
This entry was posted by Andrew B on Thursday, October 8th, 2009 at 3:12 pm and is tagged with .htaccess, .htpasswd, password protect, webspace and is posted in the category Tools, Website Design. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Thank you very much, most helpful. What is the AuthUserFile path to use for the cgi server?
I thank thee.
Hi Ratbag, the easiest way to get the path for the CGI server is to run a php script containing the following command:
< ?php
Print getcwd();
?>
I'll add this to the guide soon.
Thanks. I found this v useful.
Here at Plusnet we're always trying to use clever open source things to make our lives easier. Sometimes we write our own and make other people's lives easier too!
We're a Yorkshire-based provider selling broadband and phone services to homes and businesses throughout the UK. Winner of the ISPA 2010 'Best Consumer Customer Service ISP' Award, we're proud to offer the UK's best value standalone broadband.
© Plusnet plc All Rights Reserved. E&OE
Support Library is powered by WordPress