0

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>
  • 1
    if https://www.example.com redirects to https://example.com then that can't be your only redirect rule. That rule only redirects for http (no s). – Stephen Ostermiller Aug 20 '19 at 23:03
  • And that rule only redirects to the same hostname anyway (so it couldn't redirect from www.example.com to example.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. – MrWhite Aug 20 '19 at 23:07
  • 1
    Thanks for the responses. There was another redirect I didn't know about, for www to no www, set up in the hosting control panel. And the /www redirect has stopped all of a sudden so may have been a cached redirect after all. – bucktronic Aug 22 '19 at 6:23
2

Thanks for the responses. There was another redirect I didn't know about, for www to no www, set up in the hosting provider (OVH) control panel. And the /www redirect has stopped all of a sudden so may have been a cached redirect after all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.