简体   繁体   English

解析html资源时如何使apache区分大小写

[英]how to make apache case-sensitive when parse html resources

<html><script src="js/Test.js"></script></html>

I find the apache will load test.js or tEst.js.it doesn't care the case-sensitive. 我发现apache将加载test.js或tEst.js.它不在乎大小写。 so how to make the apache case-sensitive about javascript files and css files.I don't know which part of my apache is wrong.so how to fix that! 所以如何使apache对javascript文件和css文件区分大小写。我不知道我的apache的哪一部分是错误的。 thks THKS

On windows machines the filesystem is not case sensitive. 在Windows计算机上,文件系统不区分大小写。 I belive you can also install OSX without case sensitive file names (which is generally a bad idea). 我相信您也可以不区分大小写的文件名来安装OSX(通常这是个坏主意)。 On Linux machines the above would not work since file system it is case sensitive. 在Linux机器上,上述操作将不起作用,因为文件系统区分大小写。

Edit: According to the apache manual this configuration should probably also work: 编辑:根据apache手册,此配置可能也应该起作用:

RewriteEngine On
RewriteMap lowercase int:tolower
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule (.*) ${lowercase:$1} [R,L]

It requires that you enable mod-rewrite in your apache conf. 它要求您在apache conf中启用mod-rewrite。 http://httpd.apache.org/docs/trunk/platform/windows.html http://httpd.apache.org/docs/trunk/platform/windows.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM