I have this one website I'm working on now and I wanted to protect it from the unwanted eyes.
I still wanted my admin and tester to be able to look at it, and that was easy. There a plenty tutorials out there which help you set up .htaccess file, create the passwords and so on. Just look at the Apache one.
But what was happening when someone just clicked cancel? They could still see most of the page content!
So instead of protecting my development I was making it more interesting for spying eyes.
None of the tutorials tell you how to disallow access to the website when someone clicks "cancel" instead of entering password.
And it actually is quite simple.
Instead of using this:
AuthType Basic
AuthUserFile /your_location_of_password/file
AuthName "Restricted Access - or some other title you want to show to people who try to login"
Require valid-user
AuthUserFile /your_location_of_password/file
AuthName "Restricted Access - or some other title you want to show to people who try to login"
Require valid-user
You should be using this:
AuthType Basic
AuthUserFile /your_location_of_password/file
AuthName "Restricted Access - or some other title you want to show to people who try to login"
<files '*'>
Require valid-user
</files>
AuthUserFile /your_location_of_password/file
AuthName "Restricted Access - or some other title you want to show to people who try to login"
<files '*'>
Require valid-user
</files>
Thank you Apache for NOT making it obvious.
