apache redirect http to https and www to non www

后端 未结 6 1643
陌清茗
陌清茗 2020-11-27 18:03

basically what i want is redirect al request to use HTTPS instead of http

I have this in my htaccess so far and it worked great: Code:



        
6条回答
  •  庸人自扰
    2020-11-27 18:36

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

提交回复
热议问题