destoon利用Rewrite规则设置网站安全


为增强destoon的安全性,需要进行必要的安全设置,本文以Rewrite规则设置来增加网站安全性为例说明如下:

规则一:

屏蔽非php扩展的动态文件,例如asp、aspx等,可以阻止asp、aspx等后缀的后门程序运行

RewriteRule ^(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ /404.php

规则二:

屏蔽站点file目录php运行权限,站点的file目录默认具有写入权限,当网站出现未知漏洞时,可能会被写入后门程序,阻止php运行之后,即使有后门程序也将无法运行。

RewriteRule ^(.*)/file/(.*)\.php(.*)$ /404.php

3.0及以下版本需要再加一条

RewriteRule ^(.*)/cache/(.*)\.php(.*)$ /404.php

« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3