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
- When moving a WP site, why does wp-admin redirect to old site?
- .htaccess in wp-admin produces a redirect loop
- How can I make my Admin Icon SVG color correctly? [closed]
- Is there any filter to disable the total fronted in WordPress
- How to wrap admin menus and menu headers in additional divs without modifying the WordPress core?
- Multisite wp-admin redirect loop
- comment_form – show all fields when logged in
- Using List Table Filters for ALL Custom Post Types
- Redirect HTTP to HTTPS
- What is the practical difference between is_admin() and is_blog_admin()?
- How do I set the homepage to the WordPress Admin Dashboard login?
- Today, without warning, all admin panel logins redirect to home page after login. non-admin users logins work well
- Infinite loop behind SSL proxy on non-standard port
- What is wrong with this code to remove wp admin bar from one page
- Display checked in checkbox theme admin page when reloaded
- Why is unfiltered_upload not working despite being enabled?
- List All Enqueued Scripts and Styles
- ASCII to Unicode conversion and then save the data into database using WP post editor field
- 100+ terms in any taxonomy slows down post updates?
- Is WordPress Suitable for my site?
- How login is possible, if I deny login page via .htaccess with allow ip
- jQuery UI Datepicker error
- WP Core hard coded to use http://www.w3.org/1999/xhtml not HTTPS
- Fix Admin Dashboard Posts tab
- Add a custom field when adding / editing a page / post in admin panel
- View all comments on post one click
- I can’t access my wp admin dashboard
- Weird white space in admin area
- How to logout the current user without notices and warnings?
- Updated to wordpress 5.5.1 doesn’t work
- How can I change block editors suggested links to display another url (i.e. from api.mysite to www.mysite)
- WordPress Admin login redirect to homepage
- WordPress wp-admin login problem
- Disabling WP-Admin Caching in htaccess
- WordPress admin option, I can’t use jquery ajax to access my content from another file
- How to troubleshoot 404s in WordPress admin
- wp-admin won’t “remember me” in Chrome & Firefox
- Override WordPress Core File?
- WordPress Users page missing user count next to different types of users