Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I make an Apache running on Windows case-sensitive?

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.

like image 242
f3lix Avatar asked Feb 03 '09 13:02

f3lix


People also ask

How do I make Windows file system case sensitive?

Type the following command to enable NTFS to treat the folder's content as case sensitive and press Enter: fsutil.exe file SetCaseSensitiveInfo C:\folder\path enable In the command, remember to include the path to the folder you want to enable case sensitivity.

Are Windows Servers case sensitive?

The Windows file system supports setting case sensitivity with attribute flags per directory. While the standard behavior is to be case-insensitive, you can assign an attribute flag to make a directory case sensitive, so that it will recognize Linux files and folders that may differ only by case.

Are Windows file extensions case sensitive?

Filenames are Case Sensitive on NTFS Volumes Even though NTFS and the POSIX subsystem each handle case-sensitivity well, 16-bit Windows-based, MS-DOS-based, OS/2-based, and Win32-based applications do not.


1 Answers

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.

like image 199
Rob Prouse Avatar answered Oct 14 '22 16:10

Rob Prouse