Redirect www. to non-www and redirect all http to https with .htaccess
问题 Million times asked question, but after reading many of the answers here on SO I still can't figure this out. I need to redirect all requests like below: http://domain.tld > https://domain.tld http://www.domain.tld > https://domain.tld https://www.domain.tld > https://domain.tld http://sub.domain.tld > https://sub.domain.tld (when .htaccess placed in subdomain folder) Until now, I was using the code from html5boilerplate, that solved www to non-www <IfModule mod_rewrite.c> RewriteCond %{HTTPS