Changing subdir multisite install to subdir core directory structure

Your .htaccess lines need to look like this:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) /wordpress/wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) /wordpress/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ /wordpress/$2 [L]
RewriteRule . index.php [L]

.htaccess can’t access locations outside of the document root, that is why paths like C:\server\www\dev\ fail. (The code above has been tested on my localhost multisite install).

Because of the .htaccess rewrite, you don’t need to set WP_CONFIG_DIR and WP_CONFIG_URL they are calculated by WordPress accordingly. You can access your admin pages at http://dev.rarst.net/wp-admin or http://dev.rarst.net/subsite/wp-admin

Leave a Comment