I got a .htaccess issue, and I don't know why, because it should be working.
What I'm trying to do with this code is redirect https://www.sub.domain.com
to https://sub.domain.com
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.sub\.domain\.com$ [NC]
RewriteRule ^(.*)$ https://sub.domain.com/$1 [L,R=301]
When I test this code at http://htaccess.madewithlove.be/, it works succesfully.
(Request url: https://www.sub.domain.com
, output url: https://sub.domain.com
)
Also as mentioned in this question, I checked my DNS records , and there is an www.sub
which points to the some domain as sub
(both A's).
At this point I'm stuck, does anyone know what I did wrong? Any help would be appreciated.