Add http_host to my own header

soyglobal
soyglobal used Ask the Experts™
on
Hi, i need set my header named original-host with the value %{http_host} but not work, i only receive this result:
original-host: "%{http_host}"
How i can do it?
thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
This should work
Header add original-host %{HTTP_HOST}e

Note the e and the end, so it's written in the docs, and even if it looks weird maybe  is not a refuse
http://httpd.apache.org/docs/2.0/mod/mod_headers.html

Is this doesn't work, there's a bug. A crap workaround (not elegant for sure)  is statically define the name of your host:
Header add original-host "myownhostname"

Author

Commented:
Thanks, but return (null).
The objetive is:
have a virtualhost with many domains with seo features, this virtual host has a permanent redirect 301
to primary domain, this seo domais are rental for it i don't want put as serveralias of primary domain.

Other virtual host for primary domain that work as frontend of our application, them for pass the original domain that user arrive to our application i pass it as get variable using rewrite.
The problem is that in permanent redirect don't send the header referer automatically, and i should add the header original-host

Do you have some idea of do it better?

Author

Commented:
solution is complete but not the most clear

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial