mod_rewrite URL capitalization

-1

I'm considering using apache's mod_rewrite module to capitalize a single character in my domain name as presented to a user. For example:

www.testatest.com

would become

www.testAtest.com

  1. Is this possible?
  2. Is there any reason I might not want to do this?

Casey Flynn

Posted 2011-05-22T18:36:59.543

Reputation: 223

Question was closed 2011-10-30T23:29:37.283

Answers

1

I really don't think this would work. Best strategy, I think, would be to use the HTTP Location header in order to send the browser to testAtest.com if they went to testatest.com. Thing is, domains aren't case sensitive, so most (if not all) browsers just stick to always making them lower-case. For example, if I type "Google.com" in to Chrome 11, it downcases it to "google.com" immediately. To verify that this is not just due to google.com redirecting to www.google.com, try CE-INT.net. This server will respond directly without the www, and notice that Chrome still downcases it to ce-int.net.

A quick test indicates that Firefox and IE (latest versions of both) show the same behavior. So, even if you redirect someone to the correct capitalization, their browser will drop the caps. This is probably a technique on the part of browser makers to ensure that domains typed in different cases are still recognized as the same domain, for purposes of same-origin, history management, etc.

jcrawfordor

Posted 2011-05-22T18:36:59.543

Reputation: 15 203