This is my current htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /ouruniversity/public/index.php [NC,L,QSA]
Which redirects me all links to my entrypint in php. Now I would like to protect all / admin / routes with htaccess password. I tried to do this
# Do the regex check against the URI here, if match, set the "require_auth" var
SetEnvIf Request_URI ^/admin/ require_auth=true
# Auth stuff
AuthUserFile /ouruniversity/.htpasswd
AuthName "Password Protected"
AuthType Basic
# Setup a deny/allow
Order Deny,Allow
# Deny from everyone
Deny from all
# except if either of these are satisfied
Satisfy any
# 1. a valid authenticated user
Require valid-user
# or 2. the "require_auth" var is NOT set
Allow from env=!require_auth
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /ouruniversity/public/index.php [NC,L,QSA]
and the login form is correctly shown to me, only by clicking cancel or logging in with the wrong username and password, the contents are displayed anyway. How can I fix it?