[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[users@httpd] Redirect Permanent

Hey Guys,

I’m running Apache/2.4.33 on RHEL

I have this config:

<VirtualHost *:80>
<If "%{SERVER_PORT} != '443'">
Redirect permanent / https://${APACHE_HOSTNAME}/

<VirtualHost *:443>

When I do CURL to that localhost on port 80 it gives me back this:

<title>301 Moved Permanently</title>
<h1>Moved Permanently</h1>
<p>The document has moved <a href=""https://${apache_hostname}" class="">https://${APACHE_HOSTNAME}/">here</a>.</p>

I’m wondering why apache doesn’t transform the variable ?

Because when I do it’s showing me the ServerName variable correctly transformed.

#sh apachectl -t -D DUMP_VHOSTS

VirtualHost configuration:
*:80                   <Domain_name> (/etc/httpd/conf.d/proxy-settings.conf:3)
*:443                  <Domain_name> (/etc/httpd/conf.d/proxy-settings.conf:12)

am I missing some module ? or configuration directive ?

I also tried adding SetEnv APACHE_HOSTNAME <Domain_name>

I have the  env_module (shared) loaded.

Thanks !

( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache2-users/msg02735.html on line 70
Call Stack
10.0008368616{main}( ).../msg02735.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache2-users/msg02735.html on line 70
Call Stack
10.0008368616{main}( ).../msg02735.html:0