早睡早起,方能养生!
Sleep early rise early, way to keep healthy!

PHP如何判断网页协议是http还是https

super
2022-04-12 14:51
views 222

使用$_SERVER获取

 

$_SERVER['REQUEST_SCHEME']

 

 

版本:PHP7.1+

服务器:Nginx1.18.0

项目框架:ThinkPHP5.1+

 

站点伪静态:

 

location / {
	if (!-e $request_filename){
		rewrite  ^(.*)$  /index.php?s=$1  last;   break;
	}
}


分享
0 条讨论
top