• Resolved jaimecalvo81

    (@jaimecalvo81)


    I uppdated my server from apache to Docker,nginx, reverse proxy and added SLL thru Let’s encrypt.

    But now I can’t access /wp-admin. I can login on /wp-login.php.
    I have:
    * updated db from HTTP -> HTTPS
    * I removed .htaccess
    * renamed plugin folder
    * added this in wp-config:
    if (isset($_SERVER[‘HTTP_X_FORWARDED_PROTO’]) && strtolower($_SERVER[‘HTTP_X_FORWARDED_PROTO’]) === ‘https’) {
    $_SERVER[‘HTTPS’] = ‘on’;
    }
    * I added settings according to this forum, in the function.php of the theme:
    update_option( ‘siteurl’, ‘https://jaime.digitalconcept.se’ );
    update_option( ‘home’, ‘https://jaime.digitalconcept.se’ );
    * I get no PHP errors
    * no access errors from nginx

    It’s WP ver 5.6.
    Im soon losing my mind over this, any help is very appreciated

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • 1.)
    Do other parts of your site work fine? just the /wp-admin having issues?

    2.)

    But now I can’t access /wp-admin

    When you visit the page, what does the page show? blank?

    * renamed plugin folder

    Why do you renamed plugin folder? to hard disable the plugins?

    * I added settings according to this forum, in the function.php of the theme:
    update_option( ‘siteurl’, ‘https://jaime.digitalconcept.se’ );
    update_option( ‘home’, ‘https://jaime.digitalconcept.se’ );

    Instead of the above, maybe you want to try editing wp-config.php

    define( 'WP_HOME', 'http://example.com' );
    define( 'WP_SITEURL', 'http://example.com' );
    Thread Starter jaimecalvo81

    (@jaimecalvo81)

    1) all other pages seems to work fine.
    2) if I try /wp-admin I get the response from the browser “to_many_redirects” and the browser cancels loading the page, like a 404 or 500 error.
    3) I renamed the plugins folder because that is what may guides on fixing a redirect problem on WP/wp-admin said I should do to disable all plugins, in case one of them where the problem.
    4) I have already tried that in the wp-config.php

    1.) Disable the plugins temporarily:

    I.) Rename wp-contents/plugins directory to something like wp-contents/plugins_old

    II.) Visit example.com/wp-admin/plugins.php file in your web browser, this will disable any plug-in that is “missing”.

    2.) Edit wp-config.php file for HTTP_X_FORWARDED_PROTO

    I.) Comment out your previous HTTP_X_FORWARDED_PROTO code mentioned above.

    II.) Add the following code at the top:

    
    define('FORCE_SSL_ADMIN', true);
    
    if( strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false )
       $_SERVER['HTTPS'] = 'on';
    else
       $_SERVER['HTTPS'] = 'off';
    
    Thread Starter jaimecalvo81

    (@jaimecalvo81)

    I don’t know i needed to open /wp-admin/plugins.php when renamed plugin folder.
    Now it works again. Thanks

    Glad to hear.

    Yes, as far as I know, that’s what you need to do to disable the plug-ins.

    However, to explain the cause further:
    It’s probably not due to disabling the plug-ins that fixed the issues (disabling is only for insurance), but the code snippet that I posted above that fixed the issue. Your web server and reverse proxy were running in an infinite loop due to WordPress not being properly configured to know there is a SSL reverse proxy in place; that’s why you were getting ERR_TOO_MANY_REDIRECTS from you web browser.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘To many redirect on /wp-admin’ is closed to new replies.