All our webpages are redirecting between www. and http in an endless loop. On desktop, this is causing our homepage to load and all other webpages to redirect back to the homepage. On mobile, the infinite redirects are causing the site to timeout (and not load).
We have managed to get in to the Wordpress PHP file using the FTTP through the server, so we can make changes to the site, but we still can’t resolve the issue.
We have tried deactivating all wordpress plugins, resetting the htaccess file & fixing the wordpress URLs.
Our site has now been down for 48 hours so desperate for help please!
Though redirects are occurring, you still need to fix some of them. Requests for http are being redirected to https with the port added to the URL, which is not wrong, but not ideal either. Requests for https go to port 443 whether or not the port is mentioned in the URL.
Also, not all redirects are passing on the path. So a request for:
http://www.example.com/about-us/ is going to https://example.com:443/
This is an issue that may be masked by some browsers, such as Chrome, as they automatically redirect from http to https, but some older devices may still face the wrong redirect.
This is something that needs to be fixed at the origin server. I know it’s not a redirect caused by the WordPress core, as it normally returns a X-Redirect-By: WordPress header, which isn’t happening. But it is in fact a redirect set at the origin, so it could be a directive in the .htaccess file, or a setting in your theme, or any redirection, security or caching/optimization plugin.
Check your plugins to see if they may have a configurable option to include or not the port number in the URL, and they sure need to have an option to include the path.
To mitigate this while you investigate your origin settings, and perhaps as a permanent solution, since a redirect done at the edge by Cloudflare is better for performance and security, you could add a Redirect Rule by going to the Cloudflare Dashboard > Rules > Redirect.