Redirecting http subdomain to https subdomain

Tomy666

Verified User
Joined
Jan 12, 2020
Messages
31
Location
Poland
Hello :)
I am creating an ssl Letsencrypt for the domain aliases. mail.domain.com, smtp.domain.com, imap.domain.com, etc. The certificates are working fine. How do I force an https redirect for aliases. I tried to add code to httpd.conf: Unfortunately it doesn't work ;-/
Code:
RewriteEngine On
RewriteCond% {HTTP_HOST} ^ (. *) $ [NC]  
RewriteRule ^ https: //% 1% {REQUEST_URI} [L, NE, R = 301]
[/CODE]

Please give me some tips :) Thanks
 
Last edited:
Thanks for you answer :)
I have added to SerwerAlias in httpd.config *.domain.com
dann i have redirect force 301 to https
it's work good now :)
 
Back
Top