←Back

If you only want certain people to view your website, you can lock it behind a password (or several), like so; using .htaccess and .htpasswd files. It will make your website considerably slower, at least that’s my experience.

image.png

  1. in .htaccess, add below everything else:
AuthType Basic
AuthName "restricted area"
AuthUserFile /path/to/the/directory/you/are/protecting/.htpasswd
# eg in my case above would be  /home/aleidsusername/spicemixes.nl/.htpasswd, if you use public_html, add that after username. 
require valid-user
  1. in .htpasswd, put a generated username and password:

(TransIP | .htpasswd genereer tool)

e.g. for username test, password test, this is the entire htaccess file:

test:$2a$13$TdTjHa2oOrL.dXHcFPw1L.7zyjTpnNfoB9y/X1/n76ekF18dA7HAK

Add more users on new lines.