views:

1178

answers:

4

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.

A: 
Ryan Guill
The question in this thread is "How can i make apache **case in sensitive** ?" and mod_spelling "corrects misspellings of URLs that users might have entered, **by ignoring capitalization** and by allowing up to one misspelling."Simply put, this is for Linux users who want Windows behaviour...
f3lix
The forum you are referring to does not offer a solution to make Apache on Windows case sensitive. Only the other way around; case insensitive on unix systems.
bouke
can you not do the reverse of this? The forum does mention what you are looking for below where this answer that I quoted was but the person never came back and said if it worked or not. Have you tried it? I am still looking though.
Ryan Guill
+1  A: 

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.

Rob Prouse
I had also the idea to use virtualization software (VMware, etc.) to run Apache on Linux and I expected to get this kind of answer. But what bugs me is, that IMHO it should be possible on Windows ...
f3lix
A: 

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

an0nym0usc0ward
The problem is that it doesn't work very well and many Windows programs don't support it.
BobbyShaftoe
A: 

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.

BobbyShaftoe
CheckSpelling does not help as you can only use it to cover up mistakes on a case-sensitive file system. If for example, I zip my website to give it to somebody for offline reading, I cannot tell him to install Apache with CheckSpelling enabled to avoid stumbling over dead links
f3lix
That's why you need to do the first part of what I suggested.
BobbyShaftoe