Thursday, May 2, 2013

Force a domain to only use SSL and fix double login problem with htaccess file

If you really want to be sure that your server is only serving documents over an encrypted SSL channel (you wouldn't want visitors to submit a htaccess password prompt on an unencrypted connection) then you need to use the SSLRequireSSL directive with the +StrictRequire Option turned on.
 SSLOptions +StrictRequire
SSLRequire %{HTTP_HOST} eq "" #or
ErrorDocument 403
The cool thing about using the mod_ssl instead of mod_rewrite to force SSL is that apache give mod_ssl priority ABOVE mod_rewrite so it will always require SSL. (may be able to get around first method using or
Disqus Comments