dongpaipu8394 2013-11-21 16:58
浏览 40
已采纳

重定向到SSL页面的所有流量

I am attempting to redirect all traffic to Secure pages. I attempted an to try using either a PHP redirect, and an htaccess redirect. They worked, BUT, the problem is I get the following error:

"You attempted to reach domain.com, but instead you actually reached a server identifying itself as www.domain.com. This may be caused by a misconfiguration on the server or by something more serious. An attacker on your network could be trying to get you to visit a fake (and potentially harmful) version of domain.com."

We are the same domain. How do I go fixing the problem of the SSL certificate working for one domain but no the other domain?

  • 写回答

1条回答 默认 最新

  • dongyan5239 2013-11-21 17:12
    关注

    You're getting that error because the SSL cert that you have seems to be for www.domain.com and not domain.com. You're not going to be able to avoid this if people attempt to go to https://domain.com but you can canonicalize this using the same rule for redirecting to SSL:

    RewriteEngine On
    RewriteCond %{HTTPS} off [OR]
    RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
    RewriteRule ^ https://www.domain.com%{REQUEST_URI} [L,R=301]
    

    See also: http://www.digicert.com/ssl-support/certificate-name-mismatch-error.htm

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源