I’m trying to do that:
Force the https for my main domain.
http or https://www.domain.com
-> https://domain.com
http or https://domain.com
-> https://domain.com
this is htaccess coding for domain
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
this is working fine
But not for subdomains
I want result as
https://www.domain.com/index.php?username=abc => http://abc.domain.com
http://www.domain.com/index.php?username=abc => http://abc.domain.com
And always removing the www and https to http.
but no idea how to write htaccess code for subdomain