【问题标题】:Joomla does not properly force sslJoomla 没有正确强制 ssl
【发布时间】:2018-09-12 12:21:26
【问题描述】:

现状

  • 我安装了旧的 joomla 2.5.28 (blauwelint.nl)。
  • 从 LetsEncrypt 安装了一个 ssl 证书,可以正常工作。
  • 在 Joomla 设置中将强制 SSL 设置为整个站点
  • 在 htaccess 中添加以下内容以强制 www:

    RewriteCond %{HTTP_HOST} ^domain.nl [NC]
    RewriteRule ^(.*)$ https://www.domain.nl/$1 [L,R=301,NC]
    

https://domain.nl 正常工作

预期行为:总是强制 https

实际行为 在新的浏览器中,似乎也可以仅使用 http:// 打开站点,而不管设置了强制 ssl 的事实。

问题 我希望始终强制使用 https,但无法弄清楚为什么没有遵循预期的行为。

【问题讨论】:

    标签: ssl https joomla joomla2.5


    【解决方案1】:

    我一般不使用 Joomla 设置,只使用 .htaccess 规则。如果你在 Joomla 中关闭了强制 SSL,你可以使用以下命令来强制 https 和 www:

    RewriteEngine On
    RewriteCond %{HTTPS} off [OR]
    RewriteCond %{HTTP_HOST} !^www\.blauwelint.\nl$ [NC]
    RewriteRule ^(.*)$ https://www.blauwelint.nl/$1 [L,R=301]
    

    编辑:另外,请小心共享您的 Joomla 版本和域。对 2.5.x 的支持已结束。

    【讨论】:

    • 小心分享你的 Joomla 版本和域名你说得对,谢谢,我编辑了这个问题
    【解决方案2】:

    这适用于 Joomla 2.5 和 3.x 网站:

    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    

    【讨论】:

      猜你喜欢
      • 2016-01-30
      • 2015-10-31
      • 2021-11-30
      • 1970-01-01
      • 2011-09-15
      • 2015-10-04
      • 2018-11-04
      • 2014-08-11
      • 2011-05-28
      相关资源
      最近更新 更多