在 kohana 框架中,在.htaccess文件中写入
# 保护应用程序和系统文件不被查看
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]
好的,但是为什么在每个 php 文件中都需要这种安全性:
<?php defined('SYSPATH') or die('No direct access allowed.');
?
攻击者已经不能.php直接打开任何文件了吧?(因为原因不受.htaccessRewriteRule 的保护)