web hosting – Internetblog.org.uk https://www.internetblog.org.uk Web hosting, Domain names, Dedicated servers Fri, 29 Jan 2016 11:05:52 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.5 https://www.internetblog.org.uk/files/2016/01/cropped-favico-32x32.png web hosting – Internetblog.org.uk https://www.internetblog.org.uk 32 32 Password Protecting Your Directories https://www.internetblog.org.uk/post/664/password-protecting-your-directories/ Wed, 11 Nov 2009 14:51:33 +0000 http://www.internetblog.org.uk/post/664/password-protecting-your-directories/ password dialog
Question: How do I password protect a directory on my website?

Answer: Many web hosting control panels offer a “password protect” feature for your directories. If not, there is a moderately easy way to do it with an Apache .htaccess file.

First, create an .htaccess file that looks like this:

AuthUserFile /home/yourname/.htpasswd
AuthName “Password Protected”
AuthType Basic
require user yourname

Replace “yourname” with your desired username. Next, you will need to create the .htpasswd file in the location you specified. This requires you to have an encrypted password entry:

username:encryptedpassword

Use the following form to create one: Htpasswd Generator.

]]>