如何使这种的.htaccess规则不区分大小写? [英] How to make this .htaccess rule case insensitive?

查看:604
本文介绍了如何使这种的.htaccess规则不区分大小写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个规则在我的.htaccess

This is a rule in my .htaccess

# those CSV files are under the DOCROOT ... so let's hide 'em
<FilesMatch "\.CSV$">
 Order Allow,Deny
 Deny from all
</FilesMatch>

我却注意到,如果没有与CSV的小写或大小写混合的扩展名的文件,它会被规则忽略并显示出来。

I've noticed however that if there is a file with a lowercase or mixed case extension of CSV, it will be ignored by the rule and displayed.

如何让我这个不区分大小写?

How do I make this case insensitive?

我希望这不会回落到\(?: CSV | CSV)。$(这我不知道,甚至会的工作,并没有按T涵盖所有基地)

I hope it doesn't come down to "\.(?:CSV|csv)$" (which I'm not sure would even work, and doesn't cover all bases)

注意:的文件是在文档根目录下,并通过第三方服务上传的自动那里,所以我倒是preFER实施困扰他们的规则,我的最终替代。当初的 I 的这个站点设置了,虽然,我会去的文档根以上。

Note: The files are under the docroot, and are uploaded automatically there by a 3rd party service, so I'd prefer to implement a rule my end instead of bothering them. Had I set this site up though, I'd go for above the docroot.

感谢

推荐答案

这个页面从Apache文档说,你可以做到这一点是这样的:

This page from the apache docs says that you can do it like this:

<FilesMatch \.(?i:csv)$>

这篇关于如何使这种的.htaccess规则不区分大小写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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