的.htaccess或其他网址区分大小写或其他、大小写、网址、htaccess

由网友(青春是个欠砸的杯具)分享简介:我的服务器是大小写敏感的,和id喜欢把它忽略不计。我的意思的例子是可以说,我上传Fruit.php 好了,然后去这个文件不会工作:www.website.com/fruit.php 而将这样一句: www.website.com/Fruit.php 有没有办法让Fruit.php和fruit.php是否行...

我的服务器是大小写敏感的,和id喜欢把它忽略不计。 我的意思的例子是 可以说,我上传Fruit.php 好了,然后去这个文件不会工作: www.website.com/fruit.php 而将这样一句: www.website.com/Fruit.php 有没有办法让Fruit.php和fruit.php是否行得通呢?还与目录。即: /Script/script.php /script/Script.php

My server is Case Sensitive, and id like to turn it to inSensitive. Example of what I mean is lets say I upload Fruit.php Well then going to this file wont work: www.website.com/fruit.php but this one will: www.website.com/Fruit.php Is there a way so Fruit.php and fruit.php will work? also with the directories. i.e: /Script/script.php /script/Script.php

推荐答案

区分大小写依赖于文件系统,而不是Apache的。然而有一个部分解决方案,。 mod_rewrite的可强制一切小写(或大写),像这样:

Case sensitivity depends on the file system, not Apache. There is a partial solution, however. mod_rewrite can coerce everything to lowercase (or uppercase) like so:

RewriteMap tolowercase int:tolower 
RewriteRule ^(.*)$ ${tolowercase:$1}

参考: http://httpd.apache.org/docs/ 2.2 / MOD / mod_rewrite.html#RewriteMap指令

不幸的是,这只能如果所有的文件都是小写的,而您指定大小写混合的文件名(Fruit.php。)你舒服重命名项目中的小写字母的所有文件?

Unfortunately, this only works if all your files are lowercase, while you specifies mixed case filenames (Fruit.php.) Are you comfortable renaming all the files in your project lowercase?

阅读全文

相关推荐

最新文章