Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Setting up a multisite on a blog which root url is dev.domain.com, using subdomains. So, for example, a subsites address : site1.dev.domain.com

Everything works fine as long as i stay on the main site (dev.domain.com) When i try to access any of the other sites, I get a 404 error.

Here is my .htaccess sitting in the root

<IfModule mod_rewrite.c>
# BEGIN WordPress
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]
# END WordPress

</IfModule>

Any hint as to what is causing the 404 or suggestions to solve it would be much appreciated.

share|improve this question
    
Hi there Did it work before you added the custom rules for trailing slash and changed the upload files rule? –  Damien Jul 21 '12 at 21:54
    
no, it never worked. –  pixeline Jul 22 '12 at 8:04

2 Answers 2

up vote 1 down vote accepted

You must also register the wildcard domain *.dev.domain.com (The asterisk in as the sub-domain will usually allow you to create any sub domain you want and it will work) and point it to your main site. You can normally do this through you host's Control Panel. I didn't do this when I started with WPMU and this is what I missed.

share|improve this answer

Can you go back to wp-config.php and add this line

define('WP_ALLOW_MULTISITE', true); //change it to false afterwards  

Can you then go to /wp-admin/network/setup.php and check you copied everything correctly.

It looks to me you altered the .htaccess and missed a few lines

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

And you've put your code inside <IfModule mod_rewrite.c> which is not in the WordPress instructions

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.