lighttpd隐藏.php的方法

这篇文章将为大家详细讲解有关lighttpd隐藏.php的方法,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

我们提供的服务有:成都做网站、成都网站设计、微信公众号开发、网站优化、网站认证、霍州ssl等。为上千企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的霍州网站制作公司

lighttpd隐藏.php的方法:1、开启mod_rewrite模块;2、在“/etc/lighttpd/lighttpd.conf”中添加“url.rewrite-once=(...)”;3、进行全部配置即可。

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

关于“lighttpd隐藏.php的方法”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。


文章名称:lighttpd隐藏.php的方法
文章路径:http://csdahua.cn/article/ieiphd.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流