是HTTP_HOST服务器变量总是被定义? [英] Is the HTTP_HOST server variable always defined?

查看:124
本文介绍了是HTTP_HOST服务器变量总是被定义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是游荡,服务器变量HTTP_HOST始终为所有服务器定义,或者例如在IIS定义与其他名字,甚至都没有定义?

I just wander, the server variable HTTP_HOST is always defined for all the servers, or for example in IIS is defined with other name or even is not defined at all?

此外,该值始终定义?或者某些主机不定义价值?是否有任何其他方式以检索这个值?

Also, that value is always defined ? Or some host they don't define that value ? Is there any other way to retrive that value ?

五月这个问题是愚蠢的,但我不知道在哪里可以找到在哪里可以找到这个问题的答案:

May that question is stupid, but I am not sure where to find where to find that answer :?

亲切的问候
Merianos尼科斯

Kind regards Merianos nikos

推荐答案

引用手动

HTTP_HOST是

HTTP_HOST is

Contents of the Host: header from the current request, if there is one. 

HTTP_HOST是客户端的HTTP请求和指定哪个主机名的请求被定向到的一部分。如果HTTP_HOST没有设置,客户端可以是非常,非常古老(HTTP 1.0不支持HTTP_HOST)或者已经直接提出的要求到您的网站的IP地址。

HTTP_HOST is a part of the client's HTTP request and specifies which host name the request is to be directed to. if HTTP_HOST is not set, the client is either very, very old (HTTP 1.0 doesn't support HTTP_HOST) or has made a request directly to your web site's IP.

我觉得主机HTTP头是必须的,因为HTTP 1.1

I think the Host HTTP Header is mandatory since HTTP 1.1

这篇关于是HTTP_HOST服务器变量总是被定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆