$_SERVER[“HTTP_HOST”] fails with apache mod proxy
-
Hi there,
I recently upgraded successfully my wordpress instances, though I had to do a few fixes. I’m running on a virtual host on a shared apache instance where they are using mod proxy.
Unfortunately $_SERVER[“HTTP_HOST”] returns localhost:11008 (on our machine), and so all URIs created in the wordpress code don’t work remotely.
My system administrator tried adding the PreserveProxyHost On configuration setting but that didn’t seem to make much difference. My work around was to replace all instances of $_SERVER[“HTTP_HOST”] with $_SERVER[“HTTP_X_FORWARDED_HOST”]
I’ve published a full explanation below if you need more information:
https://www.thekua.com/atwork/2008/10/wordpress-262-interoperability-with-apache-2-mod-proxy/Should I add a bug to the wordpress bug DB?
Thanks
- The topic ‘$_SERVER[“HTTP_HOST”] fails with apache mod proxy’ is closed to new replies.