一个.htaccess文件设置内容,http跳转到https,但手机访问不跳转到http

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com [NC]
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_USER_AGENT} !(android|blackberry|googlebot-mobile|iemobile|iphone|ipod|opera\smobile|palmos|webos) [NC]
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

RewriteCond %{HTTP_HOST} ^adomain.com [NC,OR]
RewriteCond %{HTTP_HOST} ^bdomain.com [NC,OR]
RewriteCond %{HTTP_HOST} ^cdomain.com [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301,NC]

标签: htaccess, rewrite

添加新评论