How to set a single theme directory on a multisite blog?

Some days ago I’ve upgraded my single-site WP installation to support a multi-site WP website.

So I’ve created two new sites and set the same theme I was using on my single WP blog before.
But unluckily, looking at the HTML source, I’ve noticed that these new sites use a different path to retrieve their theme.
They both use “$SITENAME/wp-content/Themes/…”, while I would expect it to be merely “/wp-content/Themes/…”.

Read More

I want to change this behavior because I don’t want my visitors to download three times my website (because there are 3 sites, and each uses its own wp-content directory).

These are my settings:

define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'my-website.org' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

And this is the .htaccess:

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

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) 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).*) $1 [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(.*.php)$ $1 [L]
RewriteRule . index.php [L]

Is there a way to do what I want?
I was also considering the use of subdomains, in particular “static.my-website.org” to serve the static content, like themes, files, and so on, but if I can’t solve this, …

Related posts

Leave a Reply

1 comment