TL;DR: The custom error pages of ISPConfig were the reason for those redirects.
We have an Apache 2.4 installation in an ISPConfig environment.
Every vhost has a directory for administration purposes. My .htaccess looks like follow:
AuthType Basic
AuthName "Administration"
Require valid-user
AuthUserFile /etc/apache2/.htpasswd
Now when I hit the folder http://mysite.tld/admin
I get redirected to the website root without a login prompt.
However when I copy the .htaccess to the root, I get the login prompt.
The logfile contains the following lines when I hit on /admin
:
[Wed Feb 12 12:00:23 2020] [authz_core:debug] mod_authz_core.c(809): AH01626: authorization result of Require valid-user : denied (no authenticated user yet)
[Wed Feb 12 12:00:23 2020] [authz_core:debug] mod_authz_core.c(809): AH01626: authorization result of <RequireAny>: denied (no authenticated user yet)
And then I get straight redirected to /
.
So what can be the cause for the redirection?
Thank you in advance!
! cross-post from serverfault because of its urgency !