我有一个问题,关于用http重定向一个域名到一个不同的https域名。我已经在我的域www.some.com上安装了SSL证书(它不是通配符,所以它只对www是正确的,并且没有它在我的域上),所以如果我在https://www.some.com或http://www.some.com上一切正常,所有的请求都被重定向到https://www.some.com。
然后我已经购买了其他域名,例如,作为test.org,所以如果我想重定向这个域名到https://some.com浏览器提醒我,SSL证书只对some.com有效。
我插入的正确重写条件是:
RewriteCond %{HTTP_HOST} ^test\.org$ [OR]
RewriteCond %{HTTP_HOST} ^www\.test\.org$
RewriteRule ^/?$ "http\:\/\/some\.com\/" [R=301,L]我该如何解决这个问题呢?
发布于 2014-11-15 02:34:00
你可以使用它:
RewriteCond %{HTTP_HOST} ^(www\.)?test\.org$
RewriteRule ^/?$ http://some.com/ [R=301,L]或者所有的最终URL (test.org/xxxx/yyy...)
RewriteRule ^/?(.*)$ http://some.com/$1 [R=301,L]但是,我真的不知道你的问题是什么,或者是错误...
https://stackoverflow.com/questions/26936487
复制相似问题