0

I can't tell if this is a problem with the shopping cart system I just installed, or something I did wrong (or if it's even a real problem) -- but here is what is happening:

I have some pages on my site that are served from https (e.g. shopping cart checkout). I have other pages that are plain http (e.g. my phpBB discussion forum).

What is happening is that if I visit a secure page, then click on a link to a non-secure page, it is still showing up in the browser address bar as "https://www.foo.com/unsecure_stuff" -- with the padlock and green security indicator, etc.

If I never visit a secure page, then the rest of the site behaves as normal.

This isn't a huge deal, but some things like facebook 'like' button will not display for some reason. I also want to know what the root cause is, and how it might be fixed.

The store directory has its own .htaccess and there is this section in there - which I don't understand, but perhaps this is the reason for the continuing redirect to https?

RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteBase /store

Thanks...

4

2 回答 2

1

您的回答是正确的,如果您对链接使用相对路径,HTTPS:// 将持续存在,解决方案是按照您所说的进行操作,并使用完整的 URL 路径。

但是,据我所知,如果您有大量链接并且不想通过并更改它们,那么让整个站点运行 SSL 不是问题。也许是一个非常轻微的性能问题,但很可能你不会注意到。有关更多信息,请参阅:HTTP 与 HTTPS 性能

此外,您应该使用 iframe FB like 按钮,然后将 url 指向 // 而不是 http:// 或 https:// ,请参阅:Facebook 'Like' button breaks https/SSL

于 2013-09-04T23:44:01.643 回答
0

好的,我想我找到了原因。我访问的链接是相对的,例如“/forum”。一旦 https 在浏览器中,访问相对地址似乎会将根目录保留为 https:// 并附加相对路径。

我相信这里的解决方法是使用链接的完整路径而不是相对路径。

于 2013-09-04T23:35:53.023 回答