Need to redirect all traffic to https

后端 未结 6 1301
南笙
南笙 2020-11-29 06:11

I want to redirect any traffic that goes to http://example.com to https://example.com

same for http://example.com/about to https://example.com/about

I though

6条回答
  •  难免孤独
    2020-11-29 07:02

    After some research this what worked for me, a bit different version.

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    

提交回复
热议问题