DirectoryIndex login.html
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !login.html

# change SecretPassword by whatever you want to use as login code
# RewriteCond %{HTTP_COOKIE} !authcode=SecretPassword
RewriteCond %{HTTP_COOKIE} !authcode=SecretPassword

# if the URL is http://example.com/path/to/here/login.html
# then use
# RewriteRule ^(.*)$ /path/to/here/login.html [R=302,L]
RewriteRule ^(.*)$ /path/to/here/login.html [R=302,L]

