Skip to content

Instantly share code, notes, and snippets.

@roborourke
Last active October 27, 2022 21:46
Show Gist options
  • Save roborourke/80b2f8ec9ec88c69fb90 to your computer and use it in GitHub Desktop.
Save roborourke/80b2f8ec9ec88c69fb90 to your computer and use it in GitHub Desktop.
Get subfolder multisite wordpress to work on getpantheon.com hosting
<?php
// hack to make pantheon work with subdirectory multisite
add_action( 'wpmu_new_blog', function( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
if ( defined( 'SUBDOMAIN_INSTALL' ) && ! SUBDOMAIN_INSTALL ) {
$abspath = untrailingslashit( ABSPATH );
$subpath = $abspath . untrailingslashit( $subpath );
if ( ! is_dir( $path ) )
symlink( $abspath, $subpath );
}
}, 10, 6 );
@bowenac
Copy link

bowenac commented Mar 25, 2017

Any idea how to get existing multisite install to work on pantheon? A migrated multisite? I was able to get the sites to load on frontend by defining the WP_CONTENT_URL in wp-config, so that it would load the assets, css, js, img, etc... however the wp-admin doesn't work for the subfolder sites, only the main site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment