I want to redirect http://cpanel.domain.com to https://cpanel.domain.com what can i do?
I tried this but its not working for cPanel it just working for domain.com :
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/[0-9]+..+.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/[A-F0-9]{32}.txt(?: Comodo DCV)?$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
2
Answers
The code below is what you need for redirecting
HTTP
toHTTPS
.add this code into .htaccess file
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]