非www到www与https子域问题

时间:2017-09-05 16:16:26

标签: apache .htaccess https

我正在使用以下规则,但子域名出现问题http://sub.example.com重定向到https://sub.example.com/sub而不是https://sub.example.com

RewriteEngine On
# Redirect non-www to (ssl) www
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
# Redirect non-SSL to SSL
RewriteCond %{HTTPS} !on
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

可能是什么问题?

1 个答案:

答案 0 :(得分:0)

我能够通过以下方式解决问题:

 Reduce(rbind,Map(rbind,a,b))
      [,1] [,2] [,3] [,4] [,5]
 [1,]    1    2    3    4    5
 [2,]    3    4    5    6    7
 [3,]    2    3    4    5    6
 [4,]    4    5    6    7    8