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

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

报告相同问题?

悬赏问题

  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题