Force SSL/https using .htaccess and mod_rewrite

后端 未结 9 1869
一向
一向 2020-11-22 05:24

How can I force to SSL/https using .htaccess and mod_rewrite page specific in PHP.

9条回答
  •  天命终不由人
    2020-11-22 06:09

    This code works for me

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP:X-HTTPS} !1
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
    

提交回复
热议问题