仅使用.htaccess禁用所有子目录的php
我需要禁用子文件夹中的php脚本,而不是根index.php中的脚本 例如,我的文件:仅使用.htaccess禁用所有子目录的php,php,apache,.htaccess,Php,Apache,.htaccess,我需要禁用子文件夹中的php脚本,而不是根index.php中的脚本 例如,我的文件: index.php test.php 1/index.php 2/index.php class/*.php 2/test.php .../... .php 我想禁用根目录和类目录中除index.php之外的所有php文件 我尝试使用索引根: php_flag engine off <Files index.php> php_flag engine on </Files>
index.php
test.php
1/index.php
2/index.php
class/*.php
2/test.php
.../... .php
我想禁用根目录和类目录中除index.php之外的所有php文件
我尝试使用索引根:
php_flag engine off
<Files index.php>
php_flag engine on
</Files>
php\u标志引擎关闭
php_标志引擎打开
但这将启用所有带有index.php
的文件
现在我如何在根目录中禁用所有子文件夹expect类和所有文件expect index.php?我不明白。如果只是为了禁用文件的PHP处理,为什么需要在目录中包含PHP文件。重命名文件.txt或其他名称,并锁定目录权限,以便任何人都无法访问它。谢谢您,但需要使用Apache handler忽略它们。
php\u flag引擎关闭php\u flag引擎打开