Redirect HTTP to HTTPS

前端 未结 1 1115
醉酒成梦
醉酒成梦 2021-01-27 08:40

I currently use this code to redirect HTTP to HTTPS:

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

It\'s w

1条回答
  •  孤城傲影
    2021-01-27 09:28

    This should work better.

    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://website.com/$1 [R=301,L]
    

    0 讨论(0)
提交回复
热议问题