I’m having some issues with some .htaccess redirects only working in certain situations.

The code I have is

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

And here are the results of my tests

https://www.example.com redirects to http://example.com

https://example.com does nothing

https://www.example.com/page-name redirects to http://example.com/page-name

https://example.com/page-name does nothing

This is a WordPress site and the .htaccess code sits above the WordPress code. I have also tried it below too and I get the same results

Read more here: Issues with HTTPS to HTTP htaccess


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: