Support » Networking WordPress » Changing Multi-Site from Sub-Directory to Sub-Domain

  • Was looking at this issue on another post here: http://wordpress.org/support/topic/how-do-you-go-from-multisite-subdomain-to-subdirectorygt?replies=8 — but I want subdomains NOT subdirectories.

    I had an MU installation that was set up to use subdomains. After upgrading it’s been changed to use subdirectories and as Andrea noted in the post above it’s making permalinks use ‘blog/’ (so that solves THAT mystery).

    I do need it to have new blogs as subdomains and not sure what steps and what order best to do this. Hoping I don’t have to re-install, as I botched the upgrade to 3.0 and ended up doing a lot of extra work:

    From what I’ve heard, you have to clear or drop your table in your mySQL database and re-install wordpress… Then you have to enable multisites again, and choose subdirectories instead of sub-domains.

    FYI, my wp-config.php has (which I shouldn’t have done, but did, and it’s working so I didn’t remove it):
    define( ‘MULTISITE’, true );

Viewing 15 replies - 1 through 15 (of 35 total)
  • Andrea Rennick

    (@andrea_r)

    Customer Care at Copyblogger Media and Studiopress

    Are the child sites still using subdomains and are now not working?

    If it’s an upgraded mu install, look for define VHOST false and change it to true.

    There are no child sites — I’ve held off until I got this part OK.

    There’s no define VHOST in wp-config.php — is it in another file?

    Should I remove define MULTISITE?

    Thanks!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    Lead Plugin Wrangler

    Should I remove define MULTISITE?

    No! That’ll turn off Multisite! 🙂

    Do you have a define for subdomains set to false in that wp-config file?

    This is my wp-config.php after the specific database settings:
    —————————————————————–
    /** The Database Collate type. Don’t change this if in doubt. */
    define(‘DB_COLLATE’, ”);

    /**#@+
    * Authentication Unique Keys and Salts.
    *
    * Change these to different unique phrases!
    * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
    * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
    *
    * @since 2.6.0
    */
    define(‘AUTH_KEY’, ‘put your unique phrase here’);
    define(‘SECURE_AUTH_KEY’, ‘put your unique phrase here’);
    define(‘LOGGED_IN_KEY’, ‘put your unique phrase here’);
    define(‘NONCE_KEY’, ‘put your unique phrase here’);
    define(‘AUTH_SALT’, ‘put your unique phrase here’);
    define(‘SECURE_AUTH_SALT’, ‘put your unique phrase here’);
    define(‘LOGGED_IN_SALT’, ‘put your unique phrase here’);
    define(‘NONCE_SALT’, ‘put your unique phrase here’);

    /**#@-*/

    /**
    * WordPress Database Table prefix.
    *
    * You can have multiple installations in one database if you give each a unique
    * prefix. Only numbers, letters, and underscores please!
    */
    $table_prefix = ‘wp_’;

    /**
    * WordPress Localized Language, defaults to English.
    *
    * Change this to localize WordPress. A corresponding MO file for the chosen
    * language must be installed to wp-content/languages. For example, install
    * de.mo to wp-content/languages and set WPLANG to ‘de’ to enable German
    * language support.
    */
    define (‘WPLANG’, ”);

    /**
    * For developers: WordPress debugging mode.
    *
    * Change this to true to enable the display of notices during development.
    * It is strongly recommended that plugin and theme developers use WP_DEBUG
    * in their development environments.
    */
    define(‘WP_DEBUG’, false);

    define( ‘NONCE_SALT’, ‘AL;1y<$0XzFW%Z?sGCAwIDbG!SmI;jJrJZuC{._(zTa+_d3d<EJKt.zEs7?@D?!#’ );

    define( ‘MULTISITE’, true );

    /* That’s all, stop editing! Happy blogging. */

    /** 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’);

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    Lead Plugin Wrangler

    *blink* Wow. There’s … some stuff missing.

    Okay, to start with, you have two NONCE_SALT defines. Yank the second one, just above MultiSite.

    Then where you have Multsite as true, put this:

    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );

    There’s more stuff I think you’re missing, but I have to assume that your install is in root and not a subfolder, and that you’re using site #1 as your main site (I don’t, don’t ask why, don’t do it).

    But. This may also need to be added. Let’s just do that first bit, though.

    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'yourdomain.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    Andrea Rennick

    (@andrea_r)

    Customer Care at Copyblogger Media and Studiopress

    You don;t have the network set up yet.

    Thanks ipstenu — deleted that second NONCE_SALT and added the define SUBDOMAIN_INSTALL and now it is setting up as subdomains so I tried adding one, but when I go to visit or go to backend I get page not found. I tried adding the other code you suggested and same thing. Do I need to do something else to get the subdomain to work?

    I had compared config file to another MU site I upgraded and eventually got working ‘properly’ and it’s also missing all this other stuff. It’s using subdomains and domain mapping. Is that one going to break on me at some point without this other code?

    I definitely need subdomains on the one I am working on at the moment — and another I still have to upgrade to 3.0.

    Should I look at the pre-3.0 wp-config.php for the settings I’m missing?

    This was from the pre-3.0 config file, but not in my new one:

    /** The Database Collate type. Don’t change this if in doubt. */
    define(‘DB_COLLATE’, ”);
    define(‘VHOST’, ‘yes’);
    $base = ‘/’;
    define(‘DOMAIN_CURRENT_SITE’, ‘yourdomain.com’ );
    define(‘PATH_CURRENT_SITE’, ‘/’ );
    define(‘SITE_ID_CURRENT_SITE’, 1);
    define(‘BLOGID_CURRENT_SITE’, ‘1’ );

    Is this where I am going wrong with these upgrades? Using the new config file and only adding a couple of lines as noted in the instructions I’m using. Should I be adding a lot more from the original config file?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    Lead Plugin Wrangler

    Put those back in.

    I think define('VHOST', 'yes'); is now define( 'SUBDOMAIN_INSTALL', true );, and you still need define( 'MULTISITE', true ); in there. But if you’re removing these when you upgrade then yeah, that’s probably why it’s breaking 🙂

    Andrea Rennick

    (@andrea_r)

    Customer Care at Copyblogger Media and Studiopress

    Is this where I am going wrong with these upgrades? Using the new config file and only adding a couple of lines as noted in the instructions I’m using. Should I be adding a lot more from the original config file?

    Ann, when you are upgrading and exisiting WPMU install, there is no instructions that I know of that say to edit the config file when you;re upgrading from mu to 3.0.

    Do not edit the config file.

    At least for the upgrade part, because now we have TWO issues in this thread. :-/

    I do know I was prompted to edit my config file when I upgraded my mu, like this:
    http://developersmind.com/files/2010/06/update-wp-config.png

    Andrea Rennick

    (@andrea_r)

    Customer Care at Copyblogger Media and Studiopress

    @raskull – we;re not talking about the one-line edit. ann keeps putting in the new 3.0 network setup config lines when she;s upgrading from MU. you know the ones when you set up a fresh new network? When upgrading you do not need to do that. that’s where she’s getting turned around.

    Ah, I see! I almost went down that road myself, and I think you put me off that notion in another thread…

    Andrea, what’s my best tactic to get back on track with this site?

    The database is laid out as follows:
    wp_blogs
    wp_blog_versions
    wp_commentmeta
    wp_comments
    wp_links
    wp_options
    wp_postmeta
    wp_posts
    wp_registration_log
    wp_signups
    wp_site
    wp_sitecategories
    wp_sitemeta
    wp_terms
    wp_term_relationships
    wp_term_taxonomy
    wp_usermeta
    wp_users

    Should I ‘roll back’ to a single site and then turn it into a multi-site?

    If I want to customize a certain page under a sub-blog, do I need to change from domain.com/sub1 to sub1.domain.com?
    I know I can create a page-{ID}.php for a custom page under the root blog, but I can’t know how do do it with a sub-directory sub-blog. Thought maybe there is a way to do it with a sub-domain, sub-blog.
    Does that make sense?
    See it in action:
    http://newbirthoffreedom.org/
    http://newbirthoffreedom.org/calendar calls a specific page-calendar.php and works fine.

    Now, try a sub-blog:
    http://newbirthoffreedom.org/adventure/
    http://newbirthoffreedom.org/adventure/calendar still has the sidebars. How do I have that sub-blog page use the page-calendar.php file?
    Thanks!

Viewing 15 replies - 1 through 15 (of 35 total)
  • The topic ‘Changing Multi-Site from Sub-Directory to Sub-Domain’ is closed to new replies.