Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ( ?x=foo is different from ?x=Foo ) 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?

like image 641
Piskvor left the building Avatar asked Jun 02 '09 16:06

Piskvor left the building


2 Answers

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.

like image 118
user1686 Avatar answered Oct 14 '22 07:10

user1686


No, this shouldn't make any difference.

Check out the URL RFC Spec (http://www.ietf.org/rfc/rfc1738.txt). From section 2.1:

For resiliency, programs interpreting URLs should treat upper case letters as equivalent to lower case in scheme names

like image 41
Alex Beardsley Avatar answered Oct 14 '22 07:10

Alex Beardsley