阻止htaccess中的特定扩展

阻止htaccess中的特定扩展

本文介绍了阻止htaccess中的特定扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个目录,其中包含以下文件:

I have a directory with files like:

/files/archive.01.json
/files/archive.02.json
/files/archive.03.json
/files/hello.php

我需要.htaccess来阻止对该目录中所有.json文件的访问。有想法吗?

I need the .htaccess to block access to all .json files in that directory. Any ideas?

推荐答案

尝试一下:

<Files "*.json">
    Order Deny,Allow
    Deny from all
</Files>

这篇关于阻止htaccess中的特定扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 19:14