1

I have http://www.example.com and I want it to be https://example.com.

I'm using the following .htaccess rule but it's not redirecting properly from https://www.example.com

RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]

RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
4

0 回答 0