Re: [users@httpd] Redirect Permanent

2018-06-14 Thread Frank Gingras
You would need to use mod_macro in this case.

On Thu, Jun 14, 2018 at 11:50 AM David Tkacik <
dtka...@healthcoachinstitute.com> wrote:

> Hey Guys,
>
> I’m running Apache/2.4.33 on RHEL
>
> I have this config:
>
> 
> ServerName "${APACHE_HOSTNAME}"
> 
> Redirect permanent / https://${APACHE_HOSTNAME}/
> 
> 
> 
>
> 
> ServerName "${APACHE_HOSTNAME}"
> 
>
> When I do CURL to that localhost on port 80 it gives me back this:
>
> 
> 301 Moved Permanently
> 
> Moved Permanently
> The document has moved https://${APACHE_HOSTNAME}
> /">here.
> 
>
> 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   
> (/etc/httpd/conf.d/proxy-settings.conf:3)
> *:443  
> (/etc/httpd/conf.d/proxy-settings.conf:12)
>
> am I missing some module ? or configuration directive ?
>
> I also tried adding SetEnv APACHE_HOSTNAME 
>
> I have the  env_module (shared) loaded.
>
> Thanks !
>
>
>


[users@httpd] Redirect Permanent

2018-06-14 Thread David Tkacik
Hey Guys,

I’m running Apache/2.4.33 on RHEL

I have this config:


ServerName "${APACHE_HOSTNAME}"

Redirect permanent / https://${APACHE_HOSTNAME}/ 




ServerName "${APACHE_HOSTNAME}"


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


301 Moved Permanently

Moved Permanently
The document has moved https://${APACHE_HOSTNAME} 
/">here.


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(/etc/httpd/conf.d/proxy-settings.conf:3)
*:443   (/etc/httpd/conf.d/proxy-settings.conf:12)

am I missing some module ? or configuration directive ?

I also tried adding SetEnv APACHE_HOSTNAME 

I have the  env_module (shared) loaded.

Thanks !




Re: [users@httpd] redirect permanent not working

2011-03-08 Thread Eric Covener
On Tue, Mar 8, 2011 at 9:10 AM, Jeff Shearer  wrote:
> I am unable to successfully redirect traffic after moving 4 files from one 
> location to another.  I have the following code in the virtual host container:
>
> Redirect permanent http://www.trustedtechpro.com/marks.html 
> http://www.trustedtechpro.com/policies/marks.html
> Redirect permanent http://www.trustedtechpro.com/terms.html 
> http://www.trustedtechpro.com/policies/terms.html
> Redirect permanent http://www.trustedtechpro.com/privacypolicy.html 
> http://www.trustedtechpro.com/policies/privacypolicy.html
> Redirect permanent http://www.trustedtechpro.com/policyarchive.html 
> http://www.trustedtechpro.com/policies/archive/index.html

Redirect takes a URL-path, not a full URL.

http://httpd.apache.org/docs/current/mod/mod_alias.html#redirect

Redirect [status] URL-path URL

Example:

Redirect /service http://foo2.example.com/service

-
The official User-To-User support forum of the Apache HTTP Server Project.
See http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
   "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[users@httpd] redirect permanent not working

2011-03-08 Thread Jeff Shearer
I am unable to successfully redirect traffic after moving 4 files from one 
location to another.  I have the following code in the virtual host container:

Redirect permanent http://www.trustedtechpro.com/marks.html 
http://www.trustedtechpro.com/policies/marks.html
Redirect permanent http://www.trustedtechpro.com/terms.html 
http://www.trustedtechpro.com/policies/terms.html
Redirect permanent http://www.trustedtechpro.com/privacypolicy.html 
http://www.trustedtechpro.com/policies/privacypolicy.html
Redirect permanent http://www.trustedtechpro.com/policyarchive.html 
http://www.trustedtechpro.com/policies/archive/index.html

I have tried everything I can think of but nothing seems to work.  What am I 
doing wrong?  

Thanks.
==
Jeff Shearer, CISA, CISSP

-
The official User-To-User support forum of the Apache HTTP Server Project.
See http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
   "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org