Sub directory installation with subdomains
-
Hi guys,
I’ve recently installed WordPress MultiSite with the sub directory setting (because this is what my provider, one.com, supports).
Since I do want to use subdomains I did the following:
wp-config.php [altering this line from false to true]
define( 'SUBDOMAIN_INSTALL', true );
.htaccess [changing it to this]
RewriteEngine On #rewriting wordpress stuff to the root RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^/wp-((content|admin|includes)|((cron|login)\.php)) RewriteCond %{HTTP_HOST} ([a-zA-Z0-9-]+\.([a-z]{2,4})|co\.uk|me\.uk|org\.uk|priv\.no)$ RewriteRule ^(.*)$ http://%1/%{REQUEST_URI} [L,QSA] #rewriting everying that can't be found to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^index\.php$ - [L] # uploaded files RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L] #rewriting everything else to index.php RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteCond %{REQUEST_URI} !^/wp-(content|admin|includes|login|cron)(\.php)? RewriteRule . index.php [L]
It works almost flawless…
the sites that I create end-up nicely to be reachable subdomains. The only problem which is kind of a downer is that /wp-admin isn’t working so I cannot change the site and I’m stuck with the default template 🙂subdomain.domain.com/wp-admin is now redirecting towards http://www.domain.com/wp-signup.php?.., simply because the ‘page’ does not exist.
My question:
Is there a die-hard .htaccess person who can tell me how I can make sure that wordpress is redirecting this correctly too and my wp-admin is working on the subdomains as well?I guess if this script works it might be nice for others too 🙂
Thanks in advance,
Marcel
- The topic ‘Sub directory installation with subdomains’ is closed to new replies.