SSL and HTTP Basic Authentication
In general, when I want to force the browser to access certain part of my website via https if the request is made with http, I would put a .htaccess inside that web directory.
1 2 3 |
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} |
But when I want to protect the directory with HTTP Basic Auth, it creates double authentication. I’ll expand this section after I captures the headers.
As a quick workaround, I use this hack in .htaccess
1 2 3 4 5 6 7 |
SSLOptions +StrictRequire SSLRequireSSL AuthUserFile /home/minn/.htpasswd AuthType Basic AuthName "Private Section" Require valid-user ErrorDocument 403 https://www.minnmyatsoe.com/private/ |
Hello admin, i must say you have very interesting content here.
Your page should go viral. You need initial traffic only.
How to get it? Search for: Mertiso’s tips go viral