Http_host


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Http_host
# 1  
Old 05-24-2007
Http_host

How does the HTTP_HOST variable derive its value in a Perl environment variable?

Is it a combination of Servername, Port and Document root mentioned in the httpd.conf entry?

Thanks,
Rahul.
# 2  
Old 05-24-2007
You probably have mixed something up, if I did not misunderstand your question.

It's not HTTP_HOST that derives from a Perl env var. It's that CGI, or a similar mechanism, that exposes the HTTP/1.1 header "Host:" as the HTTP_HOST env var to the server process responsible for handling the request, which can probably be a Perl process, as specified in the CGI Specification, that writes "... the header lines received from the client, if any, are placed into the environment with the prefix HTTP_ followed by the header name. Any - characters in the header name are changed to _ characters.".

As for how the "Host" HTTP header is composed, it actually follows what the HTTP specification says about the header. To save space, you can read the specifics at http://www.w3.org/Protocols/rfc2616/....html#sec14.23.

Last edited by cbkihong; 05-24-2007 at 04:36 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. Web Development

Regex to rewrite URL to another URL based on HTTP_HOST?

I am trying to find a way to test some code, but I need to rewrite a specific URL only from a specific HTTP_HOST The call goes out to http://SUB.DOMAIN.COM/showAssignment/7bde10b45efdd7a97629ef2fe01f7303/jsmodule/Nevow.Athena The ID in the middle is always random due to the cookie. I... (5 Replies)
Discussion started by: EXT3FSCK
5 Replies
Login or Register to Ask a Question