I have a WordPress site hosted on OVH and I'm having issues when redirecting from http to https.
http://www.example.com
redirects nicely to https://www.example.com
https://www.example.com
redirects nicely to https://example.com
However http://example.com
redirects to https://example.com/www
.
I don't know where this extra www is coming from.
My .htaccess looks like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
https://www.example.com
redirects tohttps://example.com
then that can't be your only redirect rule. That rule only redirects forhttp
(nos
).www.example.com
toexample.com
even if it was processed). Maybe the redirect is being performed by the application itself? There would seem to be more about your system than what you've posted here. There is nothing here that would redirect from/
to/www
either? Check the network traffic in the browser... exactly what redirects and HTTP status codes are you seeing? And clear your browser cache to be sure you aren't seeing a cached redirect.