admin管理员组

文章数量:1122832

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/wp-admin to example/wp-login.php?redirect_to=https%3A%2F%2Fexample%2Fwp-admin%2F&reauth=1

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

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

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

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.

Share Improve this question edited Jun 5, 2024 at 21:24 Ana asked Jun 5, 2024 at 21:09 AnaAna 112 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

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

Add the below code to your wp-config.php file and observe any issues that may causes this issue and resolve them

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

本文标签: Wpadmin wrongly redirecting on multisite