Question

"Redirect loop" and "You do not have permission to access this page."

I have some problems and I have been trying for some hours but I can not. So I decided to ask here in the forum, maybe someone can help me and my doubt can also help other people.

This morning the droplet that was hosting my blog crashed and I could not get it to work again. As I had backed up the blog a few days ago with updraft, I decided to create a new droplet.

I created a new installation of Wordpress through Marketplace (one click), installed updraft again and migrated the database After migrating the database in the new droplet, I set up the domain again in the cloudflare, because I was not able to access the blog that was migrated with the links on https.

With this I was able to access the homepage of the blog and its articles, but the pages were a little messy.

When I accessed /wp-login.php I came across a redirect loop, and that loop was only on the login page.

So after doing some research I found the following code that I added to wp-config.php

define(‘WP_SITEURL’, ‘https://www.example.com’); define(‘WP_HOME’, ‘https://www.example.com’); define(‘FORCE_SSL_ADMIN’, true); define(‘FORCE_SSL_LOGIN’, true); if(isset($_SERVER[‘HTTP_CF_VISITOR’]) && strpos($_SERVER[‘HTTP_CF_VISITOR’], ‘https’)){ $_SERVER[‘HTTPS’]=‘on’; }

With this I have accessed the login page, but when typing the login and the password, the following message appears

“You do not have permission to access this page.”

Now I can not access the blog administration page, I’m stuck out of the blog and I do not know what to do, can anyone help me with this?

I’ll open a ticket, but it’s taking a while to respond


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey there,

What SSL mode do you have enabled in your Cloudflare control panel? It is most likely that Cloudflare is attempting to fetch the http version of the page through its proxy, but wordpress is forcing it to https, which is then causing the redirect loop through Cloudflare when you access that page.

The quickest solution is likely to set FORCE_SSL_ADMIN and FORCE_SSL_LOGIN to false :)