Home  >  Article  >  Backend Development  >  destoon利用Rewrite规则设置网站安全_PHP

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

WBOY
WBOYOriginal
2016-06-01 11:51:40883browse

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
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn