如果在入口文件里面定义了build_dir_secure 常量为true,还会自动给项目目录生成目录安全文件(在相关的目录下面生成空白的htm文件),并且可以自定义安全文件的文件名 dir_secure_filename ,默认是index.html,如果你想给你们的安全文件定义为default.html可以使用
define('dir_secure_filename', 'default.html');
还可以支持多个安全文件写入,例如你想同时写入index.html和index.htm 两个文件,以满足不同的服务器部署环境,可以这样定义:
define('dir_secure_filename', 'index.html,index.htm');
默认的安全文件只是写入一个空白字符串,如果需要写入其他内容,可以通过dir_secure_content参数来指定,例如:
define('dir_secure_content', 'deney access!');
下面是一个完整的使用目录安全写入的例子
define('build_dir_secure',true); define('dir_secure_filename', 'default.html'); define('dir_secure_content', 'deney access!');
