Force SSL/https using .htaccess and mod_rewrite

后端 未结 9 1650
一向
一向 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 05:51

    Simple and Easy , just add following

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

提交回复
热议问题