Reputation: 29877
The Windows file-systems (FAT, NTFS) do not care about the case of file names (case-insensitive). Consequently programs - like the Apache web server - running on windows handle file case-insenstive.
When you create web sites on Windows you inadvertently create links, etc. that do not match the case of the actual file name. You usually notice this mistakes not until you deploy the website onto case-sensitive file systems (as default on Linux, UNIX, ...).
Now, I would like to know if there is a way avoid these kind of mistakes by making the Apache web server somehow care about case even if the file-system does not care. I mean NTFS does differ between upper-case and lower-case letters in file names, so it should be theoretically possible to check whether file names match in a case-sensitive manner.
I know that naming conventions like "Only use lowercase" can help avoiding these kind of problems, but that does not help with existing files and is less convenient :-)
Also, not using Windows is not an option. I do not use Windows voluntarily and running the Apache on a different platform is not possible in this case.
Upvotes: 17
Views: 10318
Reputation: 41
So it is now possible to do this on windows 10 https://www.windowscentral.com/how-enable-ntfs-treat-folders-case-sensitive-windows-10
fsutil.exe file SetCaseSensitiveInfo C:\folder\path enable
Upvotes: 1
Reputation: 169
According to Apache documentation, it is not possible, because case insensitivity is embedded in Windows OS. But you can "reverse the problem" and turn the Apache server under Linux/Unix being case insensitive. Just add the following directives to your .htaccess:
RewriteEngine On
RewriteMap lowercase int:tolower
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule (.*) ${lowercase:$1} [R,L]
See the documentation here.
Upvotes: 4
Reputation: 1171
Windows, CAN be set to case-sensitive mode. NTFS volume is also support case-sensitive mode. If you installed UNIX interoperability before, your Windows possibly already turned into case-sensitive mode. I believe there is a switch in registry, but I forgot where it is, so I can't figure it our for you. :-(
Upvotes: 0
Reputation: 13896
It seems you can enable mod_spelling with directive CheckSpelling on in Apache configuration file.
Information and context found here: http://bytes.com/topic/apache/answers/608164-apache-case-sensitive-urls
Edit: the above was quoted for the reverse of the question, I am sorry. Someone does ask the same question that you do after that but never responds if the answer works or not. After looking further, there really doesn't seem to be a flag or any setting in apache itself to do this. Some people suggest trying to make the file system case-sensitive which does seem to be possible, but it looks like it causes more problems especially with other programs that are not expecting this.
Overall, if you cannot develop on another OS and you cannot go through and change all of your existing filenames to be lowercase (which is understandable), then it doesn't look like you really have many options. The only suggestion I would give you at this point is to try and get a testing environment, set up exactly the same as your production environment and test as much as possible before sending to production.
Sorry for the misunderstanding and that I can't be of more help.
Upvotes: 0
Reputation: 28499
This is not a problem you can solve the way you want. You need to upload your files by forcing lower case. You will avoid the naming conflict problem on Windows so if you are building things on Windows then you won't have to worry about that. Now, you need to use some sort of link checking program to find URLs that contain capital letters and then replace with lowercase equivalent.
However, Ryan Guill did make a good suggestion to enable CheckSpelling.
Upvotes: 0
Reputation: 1227
NTFS actually does support case sensitive file names. It is used and enabled by Microsoft's Services for UNIX. It is controlled in the registry. Do a google on the "ObCaseinSensitive" registry key. e.g. msdn blog and in particular this microsoft KB article: kb817921
Upvotes: 0
Reputation: 22647
As far as I know you can't, but I will watch this question for other answers.
As a workaround, you say that you must develop on Windows. What about installing Linux in a Virtual PC. There are several free VM programs like VirtualBox and Microsoft Virtual PC. That way, you can match your development environment to your deployment environment.
Beyond that, I find that it is best to just make sure you use lowercase for everything, minimizing mistakes.
Upvotes: 3