WordPress.org

Ready to get started?Download WordPress

Forums

Changing Multi-Site from Sub-Directory to Sub-Domain (36 posts)

  1. anndonnelly
    Member
    Posted 3 years ago #

    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 );

  2. 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.

  3. anndonnelly
    Member
    Posted 3 years ago #

    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!

  4. 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?

  5. anndonnelly
    Member
    Posted 3 years ago #

    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');

  6. *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 );
  7. You don;t have the network set up yet.

  8. anndonnelly
    Member
    Posted 3 years ago #

    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?

  9. anndonnelly
    Member
    Posted 3 years ago #

    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?

  10. 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 :)

  11. 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. :-/

  12. raskull
    Member
    Posted 3 years ago #

    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

  13. @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.

  14. raskull
    Member
    Posted 3 years ago #

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

  15. anndonnelly
    Member
    Posted 3 years ago #

    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?

  16. fuzzie
    Member
    Posted 3 years ago #

    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!

  17. anndonnelly
    Member
    Posted 3 years ago #

    Does this look to be good instructions to remove Multi-site? http://blog.ashfame.com/2010/07/remove-wordpress-multisite-data/

    Then to start over?

  18. anndonnelly - Don't roll back or start over just yet.

    Unless you started from Single Site (which your first post says you were using WPMU with SubDomains), rolling back could kill a lot of things.

    Do you have a good back up of BEFORE you started upgrading?

  19. anndonnelly
    Member
    Posted 3 years ago #

    I have the database and wp-config.php before upgrade -- not the other files.

    I only have the one site, not child sites -- so would I lose anything if I go back?

  20. put back the original config file that you had for starters.

  21. anndonnelly
    Member
    Posted 3 years ago #

    When I upload the pre-3.0 config file I get 'error connecting to database'.

    When I upload config file as a regular 3.0 install W/O define MULTISITE - the front end of site is fine, but I cannot access admin (and it some of the paths to images not working).

    When I upload with config file more like a regular 3.0 install except WITH define MULTISITE (and just one NONCE_SALT define 'put your unique phrase here') - the site is fine except I cannot add any child sites. So I am at this point now....

  22. Scratch what I said before.

    you started with MU, so you do NOT want to use the new network features. you're already running a network so you do not want to set it up.

    your config file needs to look like this, but with YOUR db details in it:

    http://trac.mu.wordpress.org/browser/trunk/wp-config-sample.php

  23. anndonnelly
    Member
    Posted 3 years ago #

    Sorry, which lines? I'm not getting an error message.

  24. edited my post.

  25. anndonnelly
    Member
    Posted 3 years ago #

    Example config had:
    define('VHOST', 'VHOSTSETTING');
    $base = 'BASE';
    define('DOMAIN_CURRENT_SITE', 'current_site_domain' );
    define('PATH_CURRENT_SITE', 'current_site_path' );

    Do I need to change the first two of these settings? Mine is:
    define('VHOST', 'yes');
    $base = '/';
    define('DOMAIN_CURRENT_SITE', 'progressivesolar.ie' );
    define('PATH_CURRENT_SITE', '/' );

    and these have values in my pre 3.0 file, should they remain?
    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('LOGGED_IN_SALT', 'put your unique phrase here');
    define('SECURE_AUTH_SALT', 'put your unique phrase here');

    When I use it I get 'error establishing a database connection' - could this be down to the changes made to .htaccess at upgrade?

  26. 'error establishing a database connection' means that in the wp-config.php file, either the database name, database user or database host is incorrect. that's all.

    To answer your very first question in this thread:

    "Do I need to change the first two of these settings? Mine is:
    define('VHOST', 'yes');"

    See where it says yes? That means it's a subdomain install. Change it to no.

    that will not fix the error message though. you need to fix that too.

  27. anndonnelly
    Member
    Posted 3 years ago #

    I did double check and the database info is correct. Could it be something else? I had this issue when I upgraded it it was the table names I think.

    Do I need to change VHOST if I do want it to be subdomains?

  28. Okay, a few posts earlier you said it was a single site, but in another post said it was an upgraded WPMU site. which was it?

    Because if it was originally a WPMU site then the table names should have wp_1_whatever on them. you should never change those.

    If it WAS a single WP site and you enabled the network, then you would have had to start on 3.0.

    I really really need to know what you initially installed it as, or it's going to get even more screwed up.

  29. anndonnelly
    Member
    Posted 3 years ago #

    It's an upgraded MU site - with only one site in it? Would you still call that an MU site? I only started to use MU just before the upgrade to 3.0 so didn't have a chance to add any more sites yet.

    I screwed it up at upgrade by adding that define MULTISITE and changing the wp_1_ to wp_ to get it to work :-(

  30. Yes, the table with no wp_1 is causing wordpress to think it is a network install not an MU install. rename them back.

    unless... if you get the main site working, export out ALL the posts and content you want. Then blow it away and install 3.0.1 fresh and import your content.

Topic Closed

This topic has been closed to new replies.

About this Topic