Home php教程 php手册 destoon利用Rewrite规则设置网站安全

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

Jun 13, 2016 am 09:30 AM

为增强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

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)