Skip to content

Instantly share code, notes, and snippets.

Created January 19, 2015 16:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
WP Multisite fix for WP install in a directory
Our Wordpress is located in
Here's the relevant part of our wp-config.php
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', '');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
However the "Lost your password" URL on it then set to: - so the /wordpress part is missing.
Put this into wp-content/mu-plugins
define('FV_PATH_CURRENT_SITE', '/site/');
add_filter( 'network_site_url', 'fv_network_site_url' );
function fv_network_site_url( $url ) {
$current_site = get_current_site();
if( strcmp($current_site->domain. $current_site->path, $current_site->domain.FV_PATH_CURRENT_SITE) ) {
$url = str_replace( $current_site->domain. $current_site->path, $current_site->domain.FV_PATH_CURRENT_SITE, $url );
return $url;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment