php的网站
我想让其中一个页面走https 其他页面还是走http
ci的框架 现在是页面走了https 但是当我进https的页面后 在去别的页面的话 也都变成了https了
我想知道如何配置 网站就其中一个页面是https的 其他页面还是走http
我现在是直接用php判断跳转的
if ($_server[https] on) {
$xredir = https:// . $_server[server_name] . $_server[request_uri];header(location: . $xredir);
}
o(∩_∩)o谢谢
回复内容: php的网站
我想让其中一个页面走https 其他页面还是走http
ci的框架 现在是页面走了https 但是当我进https的页面后 在去别的页面的话 也都变成了https了
我想知道如何配置 网站就其中一个页面是https的 其他页面还是走http
我现在是直接用php判断跳转的
if ($_server[https] on) {
$xredir = https:// . $_server[server_name] . $_server[request_uri];header(location: . $xredir);
}
o(∩_∩)o谢谢
比如说我希望/a/的走https,而/b/的走http
非ajax请求在过滤器中解析url,符合a链接规则的且协议是http的则跳转到https,b同理
ajax请求如果使用了jquery,可以这么干
$(document).on('ajaxsend', function (xhr, options) { if (location.protocol.indexof('https') > -1) { options.url = 'https://www.xxx.com' + options.url; } })
总之一句话,在某一处地方处理,方便维护。千万别在页面里写死链接