Incorrect redirect

I have urls that don’t want to follow Rank Math redirects on Wordpress. I have disabled all plugins and themes but I have the same error.

Example: https://giocone.com/dress-up/ does not exist, but goes to the post https://giocone.com/dress-up-games-coloring-book/. It should show the code 404. I enter the 410 redirect with Rank Math, but I get no benefit.

I have similar problems with urls going to the domain page.

Or the redirection from http://www to https://www to https://. I don’t understand why the redirect needs to appear one more and go to https://www. It does not make sense.

There are two separate issues here.

This redirection is not related to Cloudflare at all.

To confirm, temporarily pause Cloudflare and test the URL: you’ll find the redirection occurs even with Cloudflare paused.

This is just WordPress trying to be “helpful”.

WordPress has all sorts of automatic redirections (all under the redirect_canonical() mother function) that are helpful in most cases (especially to avoid duplicate content in SEO), so I won’t recommend you throw the baby out with the bathwater by completely disabling this function.

Instead, if you’d like to monitor ALL your site’s 404 errors yourself (rather than letting WordPress handle them for you), then you can disable the specific subfunction that handles 404 redirections (I believe that is redirect_guess_404_permalink()).

As this is really a WordPress issue and nothing to do with Cloudflare, please use the appropriate official WordPress support channel if you need further help with this: Documentation – WordPress.org

This may not be what you desire, but your site is working exactly as you’ve configured it to.

  1. Your WordPress site is configured to use https://example.com. So this is the base canonical URL used for all your WordPress permalinks.

  2. The above-mentioned WordPress redirect_canonical() function is redirecting https://www.example.com to your configured WordPress site address https://example.com – as it should.

  3. But WordPress does NOT handle http to https redirection, so the initial redirection from http://www.example.com to https://www.example.com is NOT being done by WordPress.

You can resolve this double redirect by setting up a Cloudflare rule to redirect www (both http and https) to https://example.com.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.