WordPress.org

Ready to get started?Download WordPress

Forums

WP 3.0 multisite subdomains (14 posts)

  1. Terranb
    Member
    Posted 4 years ago #

    Hi all,

    I'm having a bit of a problems with my wordpress 3.0 multi site install with subdomain sites.

    I've got my wildcard subdomain set up. I'm pretty sure it's correct because it does go to a page linking to the cgi-bin folder that shows up in FTP rather than the Server not found page it would if it weren't set up.

    I've created a site called "blog", which should be available at http://blog.westernma.biz

    As per the network setup instructions I've got this added to my wp-config file:

    define( 'MULTISITE', true );<br />
    define( 'VHOST', 'yes' );<br />
    $base = '/';<br />
    define( 'DOMAIN_CURRENT_SITE', 'westernma.biz' );<br />
    define( 'PATH_CURRENT_SITE', '/' );<br />
    define( 'SITE_ID_CURRENT_SITE', 1 );<br />
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    I created and .htaccess file containing this:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]

    Any thoughts what might be going wrong?

    Thanks!

  2. I've got my wildcard subdomain set up. I'm pretty sure it's correct because it does go to a page linking to the cgi-bin folder that shows up in FTP rather than the Server not found page it would if it weren't set up.

    Did you enable the wildcard vhosts in Apache?

    Does the wildcard subdomain DNS record point to your WP install?

  3. Terranb
    Member
    Posted 4 years ago #

    I thought my host had figured it out based on your comment, but it seems that's not the case. The response I got from them based on your comment is:

    "This was a change made in WHM but it does take care of the changes that are needed in apache as well."

    Does this seem correct?

    Is this definitely a web host problem, or is there something I could have messed up with my install that would cause this?

    Thanks!

  4. Terranb
    Member
    Posted 4 years ago #

    It's now working thanks to my host. They did change my .htaccess file though. They said it's the default WPMU one.

    RewriteEngine On
    RewriteBase /
    
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    Is this going to cause any problems? Is there any reason this is bad?

  5. At a quick check, yes that IS the default for MS :) You can add things into it if you want.

    I would suggest this layout:

    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>
    
    # ALL OTHER CHANGES SHOULD GO HERE
    
    # BEGIN WORDPRESS
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    </IfModule>
    #END WORDPRESS

    Why? Well, I always want to run mod-sec stuff first. Habit. And if I have redirects going on (like I moved a page and want to customize my .htaccess to account for it), that should go ABOVE the WP section. And yeah, I always comment the heck out of my .htaccess files ;)

    As you have it now, though, should be just fine.

  6. Terranb
    Member
    Posted 4 years ago #

    So there's no problem using the "old" WPMU code even though I'm using 3.0? Does that mean that code that 3.0 gives you during setup is wrong?

  7. No. The code 3.0 gives you in the setup is, IIRC, for SINGLE site. Every 3.0 install starts as single site. When you flip to mutlisite, you should have gotten directions.

    If you go to http://yourdomain.com/wp-admin/network.php you'll see directions for creating the NEW .htaccess.

    Which you will see is exactly what your host said you were missing.

  8. Terranb
    Member
    Posted 4 years ago #

    Yeah, that's where I got the code I posted originally, which wasn't working:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]

    It's similar, but not the same. Maybe my host is just different?

  9. This is mine (straight from the network settings and last night's nightly). What version of 3.0 are you running?

    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).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
  10. Terranb
    Member
    Posted 4 years ago #

    Good thought! Could've been a week ago. Or so that I last updated

  11. I suspect tweaks have occurred. I just updated to the latest and greatest htaccess rules without any issues, so yeah, they're good :)

    That was so wild, seeing three different versions.

    Anyway, I doubt there's anything wrong in using that version, but I'd probably be inclined to upgrade and use the latest since I'm one of those who likes blogging on the edge ;)

  12. Terranb
    Member
    Posted 4 years ago #

    This isn't really the place for this, but since you all were so knowledgeable about this files (which I think might be causing a problem) I thought you might have some thoughts.

    Would any of these cause problems when loaded in an external program? I have bbpress installed and it works fine, but to get my theme to work I need to load wordpress too.

    I've done this by adding require_once(dirname(__FILE__) . '/../wp-load.php'); to my bb-config.php file (like wp-config.php). This makes the screen go blank for my bbpress install.

    The funny thing is that this works perfectly well on a WP 3 single user test site, and a WP 3 multiuser site on subdirectories.

    I can't think of what else is different between the sites so is there anything about using subdomains, or the files above that might cause this?

  13. Terranb
    Member
    Posted 4 years ago #

    I figured it out. Note to self: always listen to Ipstenu and do what he says right away (ie update wordpress)

  14. *LOL* I'm a she, but thank you and you're welcome :)

    When you're running a beta and things go wiggy, I always say 'Upgrade and see if it magically fixes' mostly because I have faith in the devs!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.