There are many similar solutions on Stack Overflow such as htaccess http to https with www. Without redirecting sub domain.
What I need, however, is:
- Main domain HTTPS + NON-WWW
- Wildcard HTTP for ALL sub-domains instead of adding one after another.
I am running a WordPress Multisite website and have no wildcard SSL.
I am using the following at the moment:
Non-WWW
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} www.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Non-WWW and Non-HTTPS Sub-Domains
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !=subdomain1.main.com
RewriteCond %{HTTP_HOST} !=subdomain2.main.com
RewriteCond %{HTTP_HOST} !=subdomain3.main.com
RewriteCond %{HTTP_HOST} !=subdomain4.main.com
SSL
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Is this what you want?