一、第一种方法
打开 /etc/apache2…….conf ,
标签内随便一个地方加入以下三行
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [L,R]
二、第二种方法
根目录 vi .htacess
RewriteEngine on
RewriteBase /
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
No comments:
Post a Comment