网站根目录新建.htaccess文件,或者在原有的.htaccess文件后面添加如下代码:
#301 redirection of https sites
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{HTTP_USER_AGENT} !MSIE/[1-8]\. [NC]
RewriteCond %{HTTP_HOST} mspace.tech
RewriteRule ^.*$ https://mspace.tech%{REQUEST_URI} [L,R=301]
重启Apache, OK : )