首页 文章

将站点重定向到https和非www .htaccess

提问于
浏览
-2

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

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

1 回答

  • 0

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

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

相关问题