We have a password-protected directory
pre_virtual_host.conf (Apache Configuration » Include Editor)
public_html/.htaccess
/admin
that is not automatically redirecting to a secure/HTTPS page. The .htaccess
has a redirect rule for the entire website, but it is not working for this directory because of the password-protection. Does anyone have suggestions?pre_virtual_host.conf (Apache Configuration » Include Editor)
Code:
<Directory "/home/myuser/public_html/admin">
AuthType Basic
AuthName "Authentication Required"
AuthUserFile /etc/apache2/htpasswd/.htpasswd
Require valid-user
ErrorDocument 401 "Authentication Required"
Options +Includes
</Directory>
Code:
#HTTPS Redirect
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Last edited by a moderator: