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

WBOY
Release: 2016-06-01 11:51:40
Original
881 people have browsed it

Rewrite

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

规则一:

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

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

Copy after login

规则二:

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

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

Copy after login

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

RewriteRule ^(.*)/cache/(.*)\.php(.*)$ /404.php
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template