lighttpd隐藏.php的方法:1、开启mod_rewrite模块;2、在“/etc/lighttpd/lighttpd.conf”中添加“url.rewrite-once=(...)”;3、进行全部配置即可。
本文操作环境:Windows7系统、PHP7.1版,DELL G3电脑
lighttpd中隐藏php后缀方法
1. 开启mod_rewrite模块
2. 在/etc/lighttpd/lighttpd.conf中添加如下 代码
url.rewrite-once=( "^/(.+)\?(.+)$" =>"/$1.php?$2", "^/(.+)$" =>"/$1.php" )
3. 全部配置
$SERVER["socket"] == ":443" { protocol = "https://" url.rewrite-once=( "^/(.+)\?(.+)$" =>"/$1.php?$2" ) ssl.engine = "enable" ssl.pemfile = "/etc/lighttpd/newcert.pem" ssl.ca-file = "/etc/lighttpd/rootca.pem" ssl.verifyclient.activate="enable" setenv.add-environment = ( "HTTPS" => "on" ) #server.name = "192.168.6.120" server.document-root = "/var/www2/" }
4. rewrite写规则参考
http://redmine.lighttpd.net/projects/1/wiki/Docs_ModRewrite
【推荐学习:PHP视频教程】
The above is the detailed content of How to hide .php in lighttpd. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version
Visual web development tools

Atom editor mac version download
The most popular open source editor
