I've tried several rewrite rules trying to make this work, but it would still redirect to https://www.*
.
What I want to achieve is to redirect, www.sub.domain.com
to https://sub.domain.com
.
This is the code I tried:
RewriteCond %{SERVER_PORT} ^80$
RewriteCond %{HTTP_HOST} ^sub\.domain\.net$ [NC]
RewriteRule .? https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]