注意:未定义的索引:HTTP不是“HTTPS”

问题描述 投票:-4回答:1

注意:未定义的索引:第20行的/home/mysite/public_html/application/config/config.php中的HTTP

$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTP'] == "on") ? "https" : "http");

这是我的第20行config.php文件。这条线路有什么问题?

Undefined index error using $_SERVER['HTTPS']

与我的问题无关,因为我之前的代码工作正常,其ssl问题导致2017年10月ssl对于http网站是强制性的,并且erro从那时开始。

php codeigniter
1个回答
1
投票

将行更改为

$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");

这一部分就是问题所在。它应该是HTTPS而不是

$_SERVER['HTTP']
© www.soinside.com 2019 - 2024. All rights reserved.