Oops, I meant HTTP_HOST instead of HOST_NAME.

 


From: [email protected] [mailto:[email protected]] On Behalf Of Nathan Quinones
Sent: Friday, January 27, 2006 4:25 PM
To: [email protected]
Subject: [Easy400Group] APACHE RewriteRule (HOST_NAME)

 

I am trying to configure the APACHE server to automatically redirect all HTTP traffic to HTTPS (SSL).  I am doing this using the following directives:

RewriteEngine on         

RewriteCond %{HTTPS} !=on

RewriteRule (.*)$ https://%{SERVER_NAME}$1 [R] 

 

The SERVER_NAME environment variable contains the host name of the server (i.e. blah.blahcompany.com).  However, internally, the users cannot get to anything that ends in blahcompany.com.  So internally they will access the server using the inside IP address of 192.168.x.x.  However the above rewrite code translates their request from http://192.168.x.x to https://blah.blahcompany.com.  This will not work because the users cannot access anything that ends in blahcompany.com.

 

So, internally I don’t want to rewrite to HTTPS.  I would rather swap out the SERVER_NAME environment variable with HOST_NAME which is supposed to have the host name part of the url that the user keyed in.  For example, if the user keyed in http://192.168.x.x, HOST_NAME should contain 192.168.x.x.  If the user keyed in http://blah.blahcompany.com the HOST_NAME should contain blah.blahcompany.com.  This is the solution that I find when I search google.

 

However, HOST_NAME is blank and as far as I can tell, it is not supported as an environment variable in APACHE on the iSeries.  Any ideas?

 

Sorry for the long windedness (is that a word?)

 

Nathan

 

 



YAHOO! GROUPS LINKS




Reply via email to