I have a Wordpress site which was migrated with some matters.
The goal is force to redirect always with https
and www
.
- http://caravelleconsulting.com -> https://www.caravelleconsulting.com/
- http://www.caravelleconsulting.com -> https://www.caravelleconsulting.com/
- https://caravelleconsulting.com -> https://www.caravelleconsulting.com/
That works EXCEPT for http://www.caravelleconsulting.com which redirects to http://www.caravelleconsulting.com without https
.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#Redirection to HTTPS AND WWW
# version 1
#RewriteCond %{HTTP_HOST} ^caravelleconsulting\.com$
#RewriteRule ^(.*)$ "https\:\/\/www\.caravelleconsulting\.com\/$1" [R=301,L]
# Version 2 - same result than the first version
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
# send to router
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
I found a third solution here but when I test with http://www.redirect-checker.org, I got a 301 Moved Permanently loop.
How can I resolve this ?