Alias /nuface /var/www/nuface <Directory /var/www/nuface> Allow from All # Create this file with "htpasswd -c /etc/nuface/apache_users username" Authtype Basic AuthName "Nuface authentication" AuthUserFile /etc/nuface/apache_users Require valid-user php_flag allow_call_time_pass_reference on ErrorDocument 401 "The password you entered was incorrect, or the username you used has not been configured. New users can be added by running htpasswd -c /etc/nuface/apache_users username" </Directory> <Directory /var/www/nuface/include> Order Deny,Allow Deny from All Allow from None </Directory> <LocationMatch /nuface> Options FollowSymLinks RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R] </LocationMatch>