Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#42453 closed defect (bug) (duplicate)

network_admin_url returns the wrong url for multisite installation

Reported by: drivdigital's profile drivdigital Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords:
Focuses: multisite Cc:


Steps to reproduce.

  1. Install wordpress in it's own folder, eg "wp".
  2. Set up as a multisite
  3. Set the network site to be eg. ""

table: wp_site

path: /

table: wp_blogs

path: /

table: ex_options

option_name: "siteurl"
option_value: ""
option_name: "home"
option_value: ""
  1. Go to ""
  2. Observe that the menu links correctly use ""
  3. Observe that links created using network_admin_url are wrong, eg. "Add new plugin". They link to "" (Missing "/wp/").

Change History (3)

#1 @dd32
7 years ago

This is quite possibly correct as-is - although I'll let someone more familiar with Multisite chime in.

Multisite requires URL rewrites for wp-(admin|content|includes) to be setup to route /wp-admin/ but also /sub-blog-name/wp-admin/ requests to /wp/wp-admin/.

#2 @drivdigital
7 years ago

Here is a workaround I made in case anyone needs it:

add_filter( 'network_admin_url', function( $url ) {
  return str_replace( '/wp-admin/', '/wp/wp-admin/', $url );
} );

#3 @flixos90
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version 4.8.3 deleted

Duplicate of #36507.

Hi @drivdigital, and welcome to Trac. Thanks for opening this ticket! :)

I've opened a similar ticket before, and the consensus so far has been that this is too much of an edge-case to be fixed, and it can easily be fixed in a small plugin. Moreover, this is likely not the only place with URL issues in multisite when WP is in a subdirectory.

Let's continue to discuss there if necessary.

Note: See TracTickets for help on using tickets.