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 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Networks and Sites | Keywords: | |
Focuses: | multisite | Cc: |
Description
Steps to reproduce.
- Install wordpress in it's own folder, eg "wp".
- Set up as a multisite
- Set the network site to be eg. "wordpress.dev"
table: wp_site
domain: wordpress.dev path: /
table: wp_blogs
domain: wordpress.dev path: /
table: ex_options
option_name: "siteurl" option_value: "http://wordpress.dev/wp/" option_name: "home" option_value: "http://wordpress.dev/"
- Go to "http://wordpress.dev/wp/wp-admin/plugins.php"
- Observe that the menu links correctly use "http://wordpress.dev/wp/wp-admin/...."
- Observe that links created using
network_admin_url
are wrong, eg. "Add new plugin". They link to "http://wordpress.dev/wp-admin/..." (Missing "/wp/").
Change History (3)
#2
@
7 years ago
Here is a workaround I made in case anyone needs it:
<?php add_filter( 'network_admin_url', function( $url ) { return str_replace( '/wp-admin/', '/wp/wp-admin/', $url ); } );
#3
@
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.
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/
.