Eli qela lilandelayo lihlala lineziphumo ebezingalunganga: Ukuba uyayikhusela indawo yakho nge htaccess / htpasswd kwaye kwangaxeshanye unyanzela uqhagamshelo lwe-SSL, uhlala ufuna iphasiwedi efanayo ukuba ingeniswe kabini (kube kanye kwi-http kwaye kwakhona emva kokungena ngempumelelo kwe-https). Ngoncedo lwamacandelo oqwalaselo aziswe kwi-Apache 2.4, ingxaki inokujongana ngokulula.
# SSL erzwingen
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Authentifizierung (nur bei verschlüsselten Verbindungen)
<If "%{HTTPS} == 'on'">
AuthUserFile /path/to/.htpasswd
AuthName "Interner Bereich"
AuthType Basic
require valid-user
</If>