0
我有两个网站htaccess的力HTTPS和WWW到非www,但子域中的HTTPS
- yourdomain.com
- reseller.yourdomain.com
现在我想迫使这两个域使用https通过Apache htaccess重定向。除此之外,主域应始终使用www而非非www。但子域reseller.yourdomain.com当然不应该使用www。
重定向应该怎么样?我试图像
RewriteEngine on
RewriteCond %{HTTPS} !^on
RewriteCond %{HTTP_HOST} !^reseller\.yourdomain\.com [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
这工作不是100%这么多东西,主域名正确重定向到WWW和SSL中,SSL重定向为subomdain只适用于reseller.yourdomain.com,而不是子网站像reseller.yourdomain.com/single-page。
谢谢!
读到这里,我可以牵你的答案:http://stackoverflow.com/questions/20894947/force-https-and-www-for-domain-and-只有https-for-subdomains-htacess – andrew
does not work :-(subdomain reseller.yourdomain.de redirects on the maindomain。 – user6573193