【问题标题】:Redirecting a site to https and non www .htaccess将站点重定向到 https 和非 www .htaccess
【发布时间】:2015-06-15 03:09:02
【问题描述】:

我似乎找不到要重定向到 https 和网站的非 www 版本的答案

所以http://www.example.com 重定向到https://example.com

【问题讨论】:

    标签: .htaccess redirect https


    【解决方案1】:

    您可以在单个规则中执行此操作:

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

    【讨论】:

      猜你喜欢
      • 2021-12-24
      • 1970-01-01
      • 1970-01-01
      • 2017-05-03
      • 2020-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多