Skip to content

Instantly share code, notes, and snippets.

@derpixler
Last active September 22, 2016 08:22
Show Gist options
  • Save derpixler/4dde34a174946d5a37c4437dcf1b1139 to your computer and use it in GitHub Desktop.
Save derpixler/4dde34a174946d5a37c4437dcf1b1139 to your computer and use it in GitHub Desktop.
Multiblemultisite in subfolder
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^(?:([_0-9a-zA-Z-]+)/?){0,2}wp-admin$ $1/wp-admin/ [R=302,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(?:(?:[_0-9a-zA-Z-]+)/){0,2}(wp-(admin|includes).*) wp/$1 [L]
RewriteRule ^(?:(?:[_0-9a-zA-Z-]+)/){0,2}(.*\.php)$ wp/$1 [L]
RewriteRule . index.php [L]
</IfModule>
<?php #place this at wp-content/
if ( !defined( 'SUNRISE_LOADED' ) )
define( 'SUNRISE_LOADED', 1 );
/* extendes url segmente to 2 */
add_action( 'site_by_path_segments_count', function (){ return 2; } );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment