Title: Wp-admin wrongly redirecting on multisite
Last modified: June 5, 2024

---

# Wp-admin wrongly redirecting on multisite

 *  Resolved [anamoreiraa](https://wordpress.org/support/users/anamoreiraa/)
 * (@anamoreiraa)
 * [2 years ago](https://wordpress.org/support/topic/wp-admin-wrongly-redirecting-on-multisite/)
 * 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:
 * ![](https://i0.wp.com/i.sstatic.net/nSX6HFWP.png?ssl=1)
 * Removing the multisite lines from wp-config.php it works normally
    -  This topic was modified 2 years ago by [anamoreiraa](https://wordpress.org/support/users/anamoreiraa/).
    -  This topic was modified 2 years ago by [anamoreiraa](https://wordpress.org/support/users/anamoreiraa/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Sebastien SERRE](https://wordpress.org/support/users/sebastienserre/)
 * (@sebastienserre)
 * [2 years ago](https://wordpress.org/support/topic/wp-admin-wrongly-redirecting-on-multisite/#post-17805599)
 * 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?
 *     ```wp-block-code
       define( 'NOBLOGREDIRECT', 'https://example.com' );
       ```
   
 *  Thread Starter [anamoreiraa](https://wordpress.org/support/users/anamoreiraa/)
 * (@anamoreiraa)
 * [2 years ago](https://wordpress.org/support/topic/wp-admin-wrongly-redirecting-on-multisite/#post-17806742)
 * Hey [@sebastienserre](https://wordpress.org/support/users/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](https://wordpress.org/support/users/anamoreiraa/)
 * (@anamoreiraa)
 * [2 years ago](https://wordpress.org/support/topic/wp-admin-wrongly-redirecting-on-multisite/#post-17814448)
 * 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)

The topic ‘Wp-admin wrongly redirecting on multisite’ is closed to new replies.

## Tags

 * [multisite](https://wordpress.org/support/topic-tag/multisite/)
 * [nginx](https://wordpress.org/support/topic-tag/nginx/)
 * [redirect](https://wordpress.org/support/topic-tag/redirect/)
 * [wp-admin](https://wordpress.org/support/topic-tag/wp-admin/)

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 3 replies
 * 2 participants
 * Last reply from: [anamoreiraa](https://wordpress.org/support/users/anamoreiraa/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/wp-admin-wrongly-redirecting-on-multisite/#post-17814448)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
