• Resolved anamoreiraa

    (@anamoreiraa)


    I have a WordPress subdirectory multisite configured on Nginx, with Cloudflare CDN. I’ve set all up on -Nginx and wp-config.php according to other websites I have functioning correctly with the multisite structure.

    On this website the wp-admin is not opening, it “duplicates” the URL when trying to access it. Usually, it should redirect from example.com/wp-admin to example.com/wp-login.php?redirect_to=https%3A%2F%2Fexample.com%2Fwp-admin%2F&reauth=1

    But on this website, is redirecting from example.com/wp-admin to example.com/wp-admin/example.com/wp-login.php?redirect_to=https%3A%2F%2Fexample.com%2Fwp-admin%2F&reauth=1

    When accessing it directly through example.com/wp-login.php it works, but the dashboard opens without CSS:

    Removing the multisite lines from wp-config.php it works normally

    • This topic was modified 4 months, 2 weeks ago by anamoreiraa.
    • This topic was modified 4 months, 2 weeks ago by anamoreiraa.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,
    In the wp-config.php lines, it should have one with an URL, your root URL. Is it the right one ?

    If so, does adding this constant is helping?

    define( 'NOBLOGREDIRECT', 'https://example.com' );
    Thread Starter anamoreiraa

    (@anamoreiraa)

    Hey @sebastienserre ! Thank you for your reply. Yes, the URL is defined correctly on wp-config.php, with DOMAIN_CURRENT_SITE, WP_HOME and WP_SITEURL

    Adding the NOBLOGREDIRECT didn’t work… You can test it trying to access brick-heading-pan.blogs.prod.stage.rock.works/wp-admin

    Thread Starter anamoreiraa

    (@anamoreiraa)

    Solved it adding an annotation to the ingress:

    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/use-regex: "true"
    nginx.ingress.kubernetes.io/configuration-snippet: |
    rewrite ^(/[^/]+)?(/wp-admin)$ $1$2/ break;
    rewrite ^(/[^/]+)?(/wp-admin/.*)$ $1$2 break;

    And changing the pathtype to ImplementationSpecific

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.