About

what kind of things interest me?

Looking for something specific?

 
SERVER_NAMEとHTTP_HOSTの違い
$_SERVER[‘HTTP_HOST’]からドメインを取得する処理でエラーが出ていたので調べてみたら

下記のようなHTTPリクエストを投げたときに
$_SERVER[‘HTTP_HOST’]と$_SERVER[‘SERVER_NAME’]で
違いがあった

GET /xxxx/ HTTP/1.0
Host: hoge.example.com:80

HTTP_HOST : hoge.example.com:80
SERVER_NAME : hoge.example.com

HTTP_HOSTはHostヘッダの内容そのもの
SERVER_NAMEはapacheのServerName
 
2011.05.09  6:39pm  
      
RSS
a Tumblr theme by Robert Boylan