0

So I'm trying to get my server configured in a specific way so that anyone who visits http://www.subdomain.domain.com or https://www.subdomain.domain.com gets redirected to https:// without the www.

What Htaccess would I need to achieve this?

Tenatious
  • 109

1 Answers1

0
RewriteEngine On

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

RewriteCond %{HTTP_HOST} ^www\.subdomain\.domain\.com$ [NC]
RewriteRule ^(.*)$ https://subdomain.domain.com/$1 [L,R=301]
GioMac
  • 4,754