Apache Basic Authentication

The new Apache 2.4 flavour:

.htaccess
# Redirect to HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
 
# Authenticate users only when using HTTPS
<If "%{HTTPS} == 'on'">
 
AuthName Admin
AuthType Basic
AuthUserFile /etc/apache2/auth/htpasswd
AuthGroupFile /etc/apache2/auth/htgroup
 
require group admin
</If>
apache/auth.txt · Last modified: 2014-12 by tb
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready