Piskvor Piskvor - 4 years ago 84
PHP Question

Does HTTP hostname case (upper/lower) matter?

In other words, does it matter whether I use http://www.example.com/ or http://wwW.exAmPLe.COm/ ?

I've been running into strange issues with host-names lately: I have an Apache2.2+PHP5.1.4 webserver, accessed by all kinds of browsers. IE6 users in particular (esp. when their UA string is burdened with numerous BHOs, no pattern yet) seem to have problems accessing the site (cookies disappear, JS refuses to load) when entering via http://www.Example.com/, but not http://www.example.com/

I've checked the HTTP and DNS RFCs, my P3P policies, cookie settings and SOP; yet nowhere I've seen even a mention of domain names being case-sensitive.

(I know path and query string are case sensitive (

is different from
) and treat them appropriately; am doing no parsing/processing on domain name in my code)

Am I doing something wrong or is this just some browser+toolbar crap I should work around?

Answer Source

Domain names are not case-sensitive; Example.com will resolve to the same IP as eXaMpLe.CoM. If a web server or browser treats the Host header as case-sensitive, that's a bug.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download