通过http和https的ExpressionEngine访问 [英] ExpressionEngine access via both http and https

查看:193
本文介绍了通过http和https的ExpressionEngine访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个ExpressionEngine网站,可以通过http和https进行访问.通过https访问时,我们的用户会收到来自IE的安全警告,因为某些资产的访问是不安全的(在这种情况下,此处引用的是CSS和图像).

We have an ExpressionEngine site we’re accessing via both http and https. Our users get security warnings from IE when accessing via https because some assets are accessed insecurely (CSS and images referenced there, in this case).

当常规配置->您网站根目录的URL"设置包含http://协议标识符(此字段为空白时,仅设置为站点域[example.com]或设置为如果没有协议[//example.com/],我们会遇到其他问题,因此这些并不是真正的选择).有问题的URL当然是在模板中使用{path =}或{stylesheet =}生成的URL.

This happens when the setting ‘General Config -> URL to the root directory of your site’ includes the http:// protocol identifier (With that field blank, set just to the site domain [example.com], or set without a protocol [//example.com/], we encounter other problems, so those are not really an option). The problematic URLs are, of course, those generated with {path=} or {stylesheet=} in the templates.

是否有一种很好的方法来获取通过与页面相同的协议交付的所有资产?

Is there a good way to get all assets delivered via the same protocol as the page?

谢谢, 斯科特

推荐答案

这是因为EE变量默认情况下不会检测或使用https,因此必须在代码中进行设置.最简单的方法是使用附加组件:

It's because EE variables don't detect or utilise https by default, so you have to set them in code. The easiest way is to use an add-on:

http://devot-ee.com/add-ons/https-support

http://devot-ee.com/add-ons/dm- force-ssl

http://devot-ee.com/add-ons/force-ssl (商业)

(不分先后),我没有用过任何一个,因此我不能推荐一个特定的插件,因为我使用了自己的插件.

(In no particular order) I've not used any of these so can't recommend a specific one as I use my own plugin.

这篇关于通过http和https的ExpressionEngine访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆