htaccess redirige el dominio a https, subdominio a http y www a non-www
Estoy tratando de hacer eso:
Forzar el https para mi dominio principal.
http or https://www.domain.com -> https://domain.com
http or https://domain.com -> https://domain.com
Pero no para subdominios
http or https://www.subdomain.domain.com -> http://subdomain.domain.com
http or https://subdomain.domain.com -> http://subdomain.domain.com
Y siempre quitando el www.
Ahora tengo eso:
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Esto redirige www a no www y http a https pero no a subdominios. El subdominio permanece con www y https.
Gracias