! Se diverso dal dominio di secondo livello (user.altervista.org è il domino di terzo livello).
Se Abilitato https per il domino di secondo livello sostituendo il RewriteRule il codice avrà tale sintassi
Codice:
# activate rewrite engine
RewriteEngine On
# set the rewrite base (required)
RewriteBase /
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule .* https://www.domain.tld%{REQUEST_URI} [L,R=301]
# if the http host has something in front of the domain name
# capture what is written after the domain name
RewriteCond %{HTTP_HOST} !^(www\.)?domain\.tld$ [NC]
# if the above is true forward user with 301 redirect to the domain name with
# www.
RewriteRule ^(.*)$ https://www.domain.tld%{REQUEST_URI} [L,R=301]