我可以让在 Windows 上运行的 Apache 区分大小写吗? [英] Can I make an Apache running on Windows case-sensitive?

查看:27
本文介绍了我可以让在 Windows 上运行的 Apache 区分大小写吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows 文件系统(FAT、NTFS)不关心文件名的大小写(不区分大小写).因此,在 Windows 上运行的程序(如 Apache Web 服务器)处理的文件不区分大小写.

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.

当您在 Windows 上创建网站时,您会无意中创建与实际文件名大小写不匹配的链接等.您通常在将网站部署到区分大小写的文件系统(Linux、UNIX 等的默认设置)后才会注意到此错误.

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, ...).

现在,我想知道是否有办法通过使 Apache Web 服务器以某种方式关心大小写,即使文件系统不关心来避免此类错误.我的意思是 NTFS 在文件名中的大写和小写字母之间确实不同,因此理论上应该可以以区分大小写的方式检查文件名是否匹配.

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 :-)

此外,不使用 Windows 也不是一种选择.我不是自愿使用 Windows,在这种情况下,不可能在不同的平台上运行 Apache.

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.

推荐答案

据我所知你不能,但我会看这个问题以获得其他答案.

As far as I know you can't, but I will watch this question for other answers.

作为一种解决方法,您说您必须在 Windows 上进行开发.在 Virtual PC 中安装 Linux 怎么样?有几个免费的 VM 程序,例如 VirtualBoxMicrosoft Virtual PC.这样,您就可以将开发环境与部署环境相匹配.

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.

这篇关于我可以让在 Windows 上运行的 Apache 区分大小写吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆