Closed (duplicate)
Project:
Drupal core
Version:
5.2
Component:
base system
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Sep 2005 at 11:37 UTC
Updated:
26 Jan 2012 at 14:00 UTC
If a drupal site is situated on an intranet and external requests are forwarded to it, the function 'conf_init' in bootstrap.inc uses the 'wrong' host name. It always uses $_SERVER['HTTP_HOST'], while in case of request forwarding it could use $_SERVER['HTTP_X_FORWARDED_SERVER'].
The following code fragment (in conf_init() ) should improve this:
if( isset( $_SERVER['HTTP_X_FORWARDED_SERVER'] ) )
$server = explode('.', rtrim($_SERVER['HTTP_X_FORWARDED_SERVER'], '.'));
else
$server = explode('.', rtrim($_SERVER['HTTP_HOST'], '.'));
Comments
Comment #1
magico commentedVerified.
Any user having this problem? Seems minor to me.
Comment #2
bdragon commentedThis is fixed in Drupal 6. See the admin/settings/performance page.
Comment #3
davesmith-1 commentedHi, amazingly, this is a problem for me. I am glad to see that it is fixed in v6, but is there a (relatively) simple mod we can make to get it active in 5.2.
I understand that this is not a big problem for most people, but it is a significant irritation for me.
This is affecting my site in particular with results from search, and in the acknowledgements of form submissions. (www.corpdata.co.uk should any of you be interested.)
Any help gratefully received.
Comment #4
davesmith-1 commentedOK, stupidity rules on our part. Change 4base_url in settings.php and we are fine. Sorry for the earlier post.
Comment #5
jbarwick commentedBut not fixed in 7 ....
Did the trick
Comment #6
jbarwick commentedI can't use the 4base_url setting...multiple applications on server...dependencies...
I guess I could use an php_admin_value in http.conf for this vhost....
But...the "if" statement works just fine. I use this in our own applications.