Finally, after MONTHS I was able to solve it.
Just add
$_SERVER['REQUEST_SCHEME'] = 'http';
$_SERVER['SERVER_PORT'] = 80;
To wp-config.php, preferably before calling wp-settings.php
Thanks to Daan Meijer for this.
PS: It was a server-side error, probably something to do with PHP process manager such as php-fpm or mod_php. The hosting company solved it without the need for the hack above.
Related Posts:
- Unable to login and wp-login.php redirects to wp-admin%2F&reauth=1?
- Too many redirects after added SSL redirect on port 80 virtual host
- Can’t access WP-Admin via HTTPS
- Random HTTPs redirections at admin area in shared hosting
- “Too many redirects” ONLY when trying to access wp-admin page
- Admin Page Redirect
- Wrong canonical link on wp-admin pages
- stop redirection on /wp-admin call to /wp-login
- wp-admin produces a 302 redirect to itself
- Users are redirected to homepage instead of wp-admin
- Upgrade to SSL Breaks Admin Dashboard
- Unwanted redirect in admin area
- Login to wp-admin “redirect_to” points to wrong URL after migration
- wp-login.php — redirect logged in users to custom URL
- Remove HTTP: from the site URL and just keep // in it
- Can’t access wp-admin Internal Server Error 500
- Can’t access admin dashboard with wp-admin without /index.php after it
- Getting “Cannot modify header information – headers already sent” error, but only on backend
- WordPress admin menu gap when debug mode is enabled?
- Change Dashboard url
- WordPress subdomain wp-admin redirects to main domain
- Which HTTP headers to use for subdomain embedding?
- SSL Partially breaking admin panel and elementor
- Why is there an intermediate redirect to https://public-url.org/wp-admin?
- Prevent /wp-admin/ from redirecting to homepage?
- https://mydomain/wp-admin redirects to wp-login.php?redirect_to=https%3A%2F%2Fmydomain%2Fwp-admin%2F&reauth=1
- Can’t login to Dashboard when changing site URL to HTTPS
- Redirect non-admin users away from wp-admin/index.php (main dashboard page) to wp-admin/profile.php
- map_meta_cap was called incorrectly error?
- WordPress (behind HAProxy and Jetty), not multisite, in sub folder – and /en/wp-admin/ keeps redirecting to /wp-admin/
- Created a new subdomain with same content. Should I add a redirect in my old subdomain?
- wp-admin – 404 after custom login form
- How to fix ‘WordPress redirection loop problem in wp-login.php page’?
- wp-admin 302 redirects
- Can’t access wp-admin, redirects to http://%24domain/wp-admin/
- Unable to properly login
- Restrict access to admin-post.php
- Redirect an entire WordPress site on a subdomain, except wp-admin
- Too Many Redirects – WP-Admin Only
- WP Admin Login keeps redirecting to login
- CPU overload spam – redirect link to wp-admin and new post
- Can’t access wp-admin after http to https change
- How do I fix wp-admin error when exporting reusable blocks?
- How to access wp-admin from original website after setting the domain redirect/forwarding
- WordPress /wp-admin redirect to wrong port in docker
- Login redirect_to url is pointing to a url with the port
- Redirect from wp-admin back to page
- mixed contents admin panel is Unsecured
- Wp-admin Redirection loop after moving to subdirectory
- Trying to login to my site redirects me to the first page
- Avoid executing a function (redirect) if I’m in the admin area
- stop customize.php redirect to login page if admin is not logged in
- wp-admin redirects to standard wordpress page
- I cannot go to http://novathon.cloud.reply.eu/wp-admin – always redirected to /wp-login
- Unable to log in as admin
- Mixed content and expired session issues with SSL and wp-admin
- Blank sign in page
- How can visitors redirect wp-admin to the homepage?
- ‘Too many redirects’ error after changing site URL in WordPress [closed]
- Why when I click on a link into the WP admin panel I am redirected to a link that doesn’t contains wp-admin prefix, so I obtain 404 error
- Https Website: CSS and JS files load in http and admin page does not load too
- Word press wp-admin redirecting to reauth=1
- Wildcard multisite wp-admin url wrongfully redirected
- How to eliminate weird 404 errors in wp-admin?
- How to redirect/rewrite all /wp-login requests
- Show all post tags on post edit screen/sidebox
- How can I enable Google Analytics on a file download link?
- What is the best method to close off the backend?
- Change Login URL Without Plugin
- Change the link of ‘Howdy’ at the top right
- Reorder custom submenu item
- Options for restricting access to wp-admin
- File exceeds upload_max_filesize, despite max filesize being large enough
- js Conflict in admin panel – I guess it’s from the core WP installation
- Create a fullwidth dashboard widget
- Share Tags Between Custom Posts in Admin
- Filter dropdown in users.php “delete user” bulk edit screen
- WordPress notification reports
- wp-admin url doesn’t allow to login and redirects to same page
- How to use underscore.js in WordPress Admin
- Need help for WordPress User Session Management?
- Force WordPress https redirect before www redirect based on site address url
- meta box on new admin page
- Admin top level menu, pointing to an external url
- Change of IP Address
- Create new user from phpMyAdmin
- How can I fix, Sorry, you are not allowed to access this page. I have tried the usual
- wp-login.php entering password nothing happens
- I cannot access my WP website after changing settings
- Making WP Admin Folder accessable JUST under a different link
- Is it possible to load an admin page inside a thickbox?
- Why would running an admin check throw a 500 error? I’m calling is_super_admin();
- I am not able to enable jQuery in theme settings
- WordPress loop in post admin view
- How to restrict user to see his comments only and admin can see everyone comments?
- theme injecting css into wp-admin
- Redirection to external site on admin
- WP-Admin not reachable
- How Can I Prevent Admin User Role Loss?
- Admin utility classes?