网站根目录新建.htaccess文件,或者在原有的.htaccess文件后面添加如下代码:
[code]#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][/code]
重启Apache, OK : )
利用301重定向实现http站到https站的跳转
网站根目录新建.htaccess文件,或者在原有的.htaccess文件后面添加如下代码:
[code]#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][/code]
重启Apache, OK : )
评论 (0)
请 登录 后发表评论,或填写以下信息:
暂无评论,快来发表第一条评论吧!