Jump to content
zbeng

Password protect your website

Recommended Posts

Warning: This tutorial uses .htpasswd and .htaccess. This process will slow down the speed of your website as it checks every directory. You also need an apache server with PHP ability to run this.

What you need:

FTP access to your server

Notepad/Wordpad/...

Basig knowledge of websites

Let's get started:

Open Notepad and create a file. This needs to be in it:

AuthUserFile Directory
AuthName "Title of log-in screen"
AuthType Basic
Require valid-user

You need to change "Directory" into the directory your website is in. For example:

www/website/members/

You need to change "Title of log-in screen" to something you want. Don't forget to keep the quotes though.

Now, when using notepad, go to save as... and save it as ".htaccess" (without the ""). Don't forget to choose 'all types' and not .txt. Otherwise you can always rename the file to '.htaccess' in the FTP browser.

The .htpasswd needs to contain a username and a encrypted password. A good tool to encrypt passwords is found here:

http://home.flash.net/cgi-bin/pw.pl

Your htpasswd file looks like this:

username:p.whLw2ZDZroU

With notepad, save it as '.htpasswd' or again, rename it within the FTP browser.

Everything is set up now, though, make sure you got these things right:

You've put the .htpasswd file in the right directory you specified in the .htaccess file.

You've got the right names. '.htpasswd' and '.htaccess' and you are sure the .'s are there too.

You've put the .htaccess file in the directory on your server you want to protect.

You've encrypted the passwords.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...