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