Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i force URLs to be case sensitive

Say I have the domain mydomain.com, and what I want to do is force the browser to show MyDomain.com in the URL bar. I have the following htaccess:

# force all to MyDomain.com
RewriteCond %{HTTP_HOST} !^www.MyDomain
RewriteRule (.*) http://www.MyDomain.com/$1 [R=301,L]

But it doesn't work. Are there any tricks/hacks that can be done to make the browser show a URL that isn't all lowercase? Or is this just not possible to do?

like image 994
paul smith Avatar asked Oct 18 '25 11:10

paul smith


1 Answers

Nope, domains and subdomains are always lowercase. The DNS system is always case insensitive.

https://www.rfc-editor.org/rfc/rfc4343

like image 62
Nathan Villaescusa Avatar answered Oct 21 '25 07:10

Nathan Villaescusa