smaller reset larger         

Main Menu

All times are in GMT -7 (DST) :: The time is now 4:10 pm.

Sub Menu

Article Data
Article Ref
1318-UHCM-2063
Date Created
Tue, 20th Apr 2010
Date Modified
Tue, 11th Dec 2012
 
(Lost?)

   Remove Case Sensitivity for URLs

Question 

I have sub-folders on my website that are capitalized and I would like my users to be able to type the upper or lower case address.

Answer 

Newer versions of Windows amd Linux will always recognize the case of a letter as two different letters, i.e. a capital 'A' is different than a lowercase 'a'. When a Windows or Linux machine is a webserver this rule also applies.  This goes for directories, usernames, passwords, etc.

One way to work around this rule is to always use lowercase. This isn't a solution but a habit for web development that allows interoperability

Another option is to use the following .htaccess directive. Adding this code to your .htaccess file will cause the server to scan all directories to find a match regardless of case and redirect the user to the target directory.

<IfModule mod_spelling.c>
CheckSpelling on
</IfModule>
  • This solution won't solve all capitalization problems but can do the job for most developers.
  • This solution can decrease server performance as it does have to scan every directory when it recieves a URL request.

Article Comments 

There are currently no comments.