Home >> Password Protect Directory With .htaccess

Tag: security

Password Protect Directory With .htaccess

To create authentication using htaccess do the following:

  1. Open up console and type htpasswd -c .htpasswd username to create .htpasswd file.
    or alternatively you can search for .htpasswd generator online
  2. Put the newly created .htpasswd file somewhere hidden.
  3. Create .htaccess file with the following content:
    AuthType Basic
    AuthName "Any title you want"
    AuthUserFile /path/to/.htpasswd
    require valid-user
  4. Put the .htaccess file inside the directory you want to password protect

Create a Unique Strong Memorable Password for Every Account

A strong password need to have the combination of letters, numbers, and symbols. Also you need to make it as lengthy as you can.
Problem is, when we have many accounts it can be hard to remember each one, not to mention the must use of combination and symbols all that stuff.

Here’s a trick I use to make unique different strong password for every account:
Create or generate a strong password that is easy for you to remember. Consider making a lengthy and full of combination password,  for tutorial purpose lets take *3X4MpL3_Pa5S# as a password.

Take the first and last letter of the site name. For example we’ll use sitename.com, so you would have s and e

Combine it with your password and you will have s*3X4MpL3_Pa5S#e as a password, and if you create an account in another site, e.g: another.com you will have a*3X4MpL3_Pa5S#r as a password.

Therefore it would be different for each account in different site. Of course this is only a simple method to create a unique pass, you can be creative and make your own pattern, that way only you will know and understand the pattern.