Support » Networking WordPress » Several Multisite Setup & htaccess Mistakes

  • Resolved Beeblebrox-BSD


    Hello. I have a clean install of WordPress 3.6 Network under www/mydomain/wordpress. I have made probably several errors in my setup.

    I plan two sites for time being:
    Num & Site || Folder || Siteurl (from Network Admin menu)
    1. mydomain || www/mydomain/wordpress || http://mydomain/wordpress
    2. rs.mydomain || www/mydomain/wordpress/rs.mydomain || http://rs.mydomain

    * Site #1 displays in http://mydomain/wordpress. I need the url to be directed to http://mydomain, and not display wordpress in the path. I cannot change Siteurl from Network Admin menu.
    * Site #2 does not display when I try to go to Site Dashboard; shows “This webpage has a redirect loop” message.

    My wp-config.php (one copy, located in mydomain/wordpress)

    /* Multisite */
    define( 'WP_ALLOW_MULTISITE', true );
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', true);
    define('DOMAIN_CURRENT_SITE', 'mydomain');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    /** Custom folder location for image uploads. */
    define( 'UPLOADS', 'wp-content/'.'images' );
    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');

    My .htaccess under www/mydomain:

    ### BEGIN WordPress
    <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
    ## ServerAlias *.mydomain ## gives int-srv-err-500
       RewriteRule ^index\.php$ - [L]
      # add a trailing slash to /wp-admin
       RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
       RewriteCond %{REQUEST_FILENAME} -f [OR]
       RewriteCond %{REQUEST_FILENAME} -d
       RewriteRule ^ - [L]
       RewriteRule ^(wp-(content|admin|includes).*) wordpress/$1 [L]
       RewriteRule ^(.*\.php)$ wordpress/$1 [L]
       RewriteRule . index.php [L]
     ### END WordPress

    For problem #2, I could do this, but the URL will show full path, which I don’t really want.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^rs.myomain$
    RewriteRule ^(/)?$ wordpress/rs.mydomain [L]

    And if I did the reverso of this for problem #1 (rewrite mydomain/wordpress/ to mydomain one folder above) I would probably break the site.


Viewing 15 replies - 1 through 15 (of 17 total)
  • Why are you using WP 3.6? You should be using the latest version. IMO, problem #1 is causing or affecting problem #2. I am not what is the best way to change the siteurl, except directly through the database. You might want to consider re-installing WP if you are comfortable doing it again… assuming this is not a currently running site.

    Why are you using WP 3.6?

    Hi, This is the highest version available on the hosting platform. I have no control over server administration.

    I am not what is the best way to change the siteurl, except directly through the database

    I have no problem doing that, except I would first like to make sure what the correct solution is. I mean, messing with the DB for fun, then trying to recover the initial settings because the “random punches” failed will be a waste.

    This is not a running site. Fresh install and born broken, because of my wrong settings I assume.

    P.S. From what I have read so far, wp-contents/blog* is no longer the default folder location for WP 3.5+

    Did you follow the standard WP installation –

    Those instructions would create a site at

    You would have to follow extra instructions to put it in (which you do not want to do)

    I recommend just re-installing WP. You will have to dump your database beforehand.

    After WP installation, you will need to create a Network. You need to decide on sub-directory or sub-domain –

    You need to decide on sub-directory or sub-domain

    I’m using sub-domain.

    Did you follow the standard WP installation …
    I recommend just re-installing WP. You will have to dump your database beforehand.

    * Nothing in the DB worth saving.
    * I previously had a test site up and running. I nuked everything and setup from scratch a Networked Site. The problem is not zero-install; its how to configure. I guarantee that I’ll run into the same issues when I re-install, because I will be doing the setup tha same way I did this one!

    Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Hi, This is the highest version available on the hosting platform. I have no control over server administration.

    You can upgrade WP from inside WP (same way you can add plugins and themes). If your hosting platform doesn’t let you do that, you need to leave them because… No. Just no. That is horrible.

    I’m on the eastern side of the Atlantic, and it had gotten pretty late by the last post. When I woke up this morning, I realized what a dunce I had been, since all of WordPress code is located under www folder and can be uploaded. Upgraded to 3.8.1 as of this morning, before I read your post. Thanks, Mika.

    Back to the problems at hand (all issues persist, btw). Let me reiterate some of the implied questions:
    * Some sources state that multisite-WP must be in domain’s folder (www/mydomain) and not in a sub-folder (www/mydomain/wordpress). This probably is not the case for 3.8.1?
    * I created a folder under wordpress/wp-content/rs.mydomain for that particular site. Several sources state that folder location is not per-site but that all sub-domain networks go into one folder (blog or whatever). This is also pre-3.8 I presume?
    * I have the mu-domain-mapping plugin installed, however I am not using it as yet because I would prefer to make sure I have all the fundamentals correctly in place before I go mucking with ifs and maybes.
    * I didn’t see how an upgrade would fix erroneous redirect/rewrite code in my htaccess/WordPress configuration – and it has not corrected the issue. The hosting firm’s banner is displayed when I direct the browser to http://mydomain. It’s only when I go to http://mydomain/wordpress that I see the site I designed. To me, this means that the htaccess setup is incorrect.
    * The http/rs.mydomain site is not resolving on the host at all. After WP upgrade, I tried to run “Upgrade Network” as instructed and got this:
    Warning! Problem updating http://rs.mydomain. Your server may not be able to connect to sites running on it. Error message: Couldn't resolve host 'rs.mydomain'
    * Should I be placing a copy of wp-config.php in folder www/mydomain (above wordpress folder)?

    You are doing too many different things! You havent even installed WP correctly and then you proceed to make more configuration changes.

    First you need to install WP correctly so that it is located in I have pointed you to the installation guide –

    Read and follow the directions.

    > Some sources state that multisite-WP must be in domain’s folder (www/mydomain) and not in a sub-folder (www/mydomain/wordpress). This probably is not the case for 3.8.1?

    That is in the installation guide. You can do either, but it depends on what you want. In this case you want WP running out of site’s root ( which means installing WP in your domain folder. However there is another guide which allows you to install WP in a sub-directory yet still allow you to run WP from the site’s root ( – Sorry this may confuse you but I wanted to give you this option.

    jkhongusc: I had already studied ALL of those codex pages before I started the thread.

    You havent even installed WP correctly

    My site was/is installed correctly. In my first post I had stated that WP was installed under www/mydomain/wordpress (as described in the Giving_WordPress_Its_Own_Directory codex article).

    I had apparently overlooked placing and modifying an index.php file under www/mydomain. Once that was done, http://mydomain started working normally and problem for site #1 is thus solved.

    Site #2 is still not working; giving 404 error. My assumption is that the request comes to the server (because all dns records are correct), but does not either
    A. Get passed to WordPress engine or
    B. WordPress setting for for this site is worng.

    multisite-WP must be in domain’s folder (www/mydomain) and not in a sub-folder (www/mydomain/wordpress). This probably is not the case for 3.8.1?

    I was referring to when I asked this. It states:

    You cannot choose Sub-domain Install (for a domain-based network) in the following cases:
    * The WordPress URL contains a path, not just a domain. (That is, WordPress is not installed in a document root, or you are not using the URL of that document root.)

    If this is still valid, it means that multi-sites will not work if WordPress is given its own sub-folder?

    Great that #1 is solved. Before proceeding to solving problem #2.

    Let’s clarify what you did. You followed the instructions of ‘Moving a Root install to its own directory’ section in Giving WordPress Its Own Directory? So now you have WP (non-network) installed. Even though it is installed in a subdirectory, it is running out of the site’s root ( so that limitation stated above does not apply because the site’s URL or WordPress URL does not contain a path.

    Here is an important decision point. Do you want to use your current WP as a multisite for or do you want to install another WP to handle that domain? You can setup your current WP to be multisite (sub-dir or sub-domain) AND that instance can host all your sub-domains (* and sub-directories (*/). This is an important decision that I cannot really help with. I can help you once you make the decision. I know how to configure both ways.

    Here is why I use WP multisite. I have a subdomain multisite system that has over 200 sites (* When I admin the site, it is one WP instance and one database instance. Think of how much work it would be if I had to upgrade 200 sites!

    Sorry, my friend, but I am way ahead of what you are explaining for me. As stated in first post:

    * WP was installed into wordpress folder. Primary site working.
    * Nothing was moved or migrated. This is a fresh setup.
    * WP Network (multisite) was activated for sub-domain setting.
    * .htaccess and wp-config.php was modified as stated in post #1
    * DNS records and hosting has been setup for wildcard (*) dns & is resolving

    I don’t know what else I can tell you. All setup has been completed according to codex, but sub-domian is not being served by WP. It’s probably a simple issue, but it’s either in .htaccess or in the WP setup IMHO. I have tried several modifications but no luck.


    Ok, so you configured WP multisite sub-domain; and configured DNS wildcard. This is good.

    I assume that you created a site called Exactly what happens when you access Are you getting a 404 error from your web server, an error page from WP, different error? AFAIK your .htaccess and wp-config.php look correct.

    Hi. When I go to, I get the server’s 404 page:

    Not Found
    The requested URL / was not found on this server.
    Apache/1.3.33 Server at Port 80

    The hosting plan does not allow for me to look through server logs, so I cannot examine what the error exactly is.

    I think I know what the problem is.

    Can you confirm that this works:

    Can you see if this works:

    Both should work, but if the first one works and the second gives you an Apache 404 error then the problem is that your subdomain ( is not mapped to the same DocumentRoot.

    As an example here is my WP sub-domain httpd.conf snippet:

    <VirtualHost *:80>
        ServerAlias *
        DocumentRoot /folder/wp

    Hello. Yes correct; the first link works while the second one does not.

    For the .htaccess modification I tried all four of the combinations below, but none work. This was placed before the “WordPress Settings” section of the file.

    DocumentRoot /wordpress OR / OR

    EDIT: The ServerAlias setting is breaking the server. It now gives “500 Internal Server Error” when I visit the previously working main site at

    Those settings in the VirtualHost cannot be applied in the .htaccess file… which is why you are seeing 500 errors.

    You need to tell your host provide that all your subdomains should use the same DocumentRoot. You previously mentioned the folder /www/mydomain/ All your subdomains should be using that folder.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Several Multisite Setup & htaccess Mistakes’ is closed to new replies.