apache wrong HTTP_HOST and SERVER_NAME in .htaccess but correct in php

322 views Asked by At

I have an apache web server, version: Apache/2.4.34 (Red Hat), on it I have multiple virtual hosts

now, in .htaccess, I have a redirect to cut the trailing slashes, but there, the variables HTTP_HOST and SERVER_NAME are always loaded with default (first) virtual host, and not with the current virtual host

and the problem to be even strange, in php those variables are loaded correctly

any idea what to do ? I spent few hours digging google with no result :(

LE seems like is not clear enough, let's just say that I have only 2 virtual hosts: www.ex.com and mail.ex.com, and first is also the default virtual host when I type httpd -S ... now, when I access mail.ex.com, in .htaccess HTTP_HOST is loaded with www.ex.com and not mail.ex.com

0

There are 0 answers