Setup .Htaccess Lock

Setup .Htaccess Locks:

  1. Login to website FTP where you want to add in the password lock to the site – the logins can be found in LastPass.
  2. Navigate to WordPress root of the site files
    1. If on Dev this is /public_html/SITENAME
    2. If on a live site this is /public_html
  3. Create 2 files in the roof of this above folder – if you are doing this through cPanel, you will need to make sure hidden files are viewable, this can be done by clicking settings in the File Manager and ticking ‘Show Hidden Files (dotfiles)’ and then Save
    1. .htaccess
    2. .htpasswd
  4. Make sure both files have the permissions 0644
  5. Copy and paste the following into the .Htaccess file:
    AuthName “Restricted Area”
    AuthType Basic
    AuthUserFile .htpasswd
    AuthGroupFile /dev/null
    require valid-user
  6. Copy and Paste the following into .htpasswd:
    admin:Q1UecezgMq84Q
    user:fbMR./cCZVnLs
  7. This will then setup the following Logins:
    admin: silvertoad
    user: silvertoad

Related Articles