The MU forums have moved to WordPress.org

Is domain mapping possible with subdirectory installs (3 posts)

  1. tomaltman
    Member
    Posted 14 years ago #

    I'm trying to setup the Wordpress MU to use different domain names. We set the site to use subdirectories.

    Can anyone point me to help or documentation on this process. Any help would be gladly appreciated.

    tom

  2. andrea_r
    Moderator
    Posted 14 years ago #

    Yes, it is possible.

    No, Donncha's domain mapping plugin doesn't do it (yet).

    There's one here tho:
    http://wpmututorials.com/simple-multi-site-plugin-e-book/

  3. tomaltman
    Member
    Posted 14 years ago #

    You need Subdomains being used instead of subdirectories for WordPress MU (We tried to use subdirectories but the login ability failed).
    To turn on subdomains go to: http://welcome.totheinter.net/2009/05/06/changing-wordpress-mu-from-subdomains-to-subdirectories/ for instructions.
    The main thing is setting:
    define('VHOST', 'yes');
    ->inside wp-config.php – this will make the switch from sub-directories to sub-domains
    For setting up the multiple domains under one WordPress MU installation, credit must be given to Richard Bui @ http://bui4ever.com/2007/06/wordpress_mu_with_domain_mapping/ for his excellent step by step guide. His guide helped create these instructions.
    It is assumed that you have setup the domains that are to be used, Richard Bui has some instructions on some of this [steps 1-11].
    1. Create the blogs that you want use if you haven’t done so already (Site Admin >Blogs > Add Blog).

    2. Access your database that WordPress MU uses through PhpMyAdmin.

    3. Navigate to wp_#_option where # is the id for the blog you want to use with a different domain (hint: the siteurl in the table will say the name of the blog).

    4. Change the siteurl, home, and fileupload url to your new domain, for the fileupload url keep the /file at the end of the url. Also make sure you put a forward slash (/) at the end of siteurl and home.

    5. Navigate to wp_blogs, click on the domain you are changing. Edit the blogs you are switching to a domain. Put in the following changes:
    site_id = blog_id
    domain = yournewdomain.com
    path = /
    Write down the blog_id for later use

    6. Navigate to wp_sitemeta, write down the meta_value for site_admins meta_key. The stuff you need to copy looks like this:
    a:1:{i:0;s:5:"admin";}

    7. Inside the wp_sitemeta table, write down the meta_value for illegal_names.

    8. Navigate back to wp_sitemeta and go to the last page, write down the last meta_id value

    9. Insert a new tuple (row) into the wp_sitemeta table with these values:
    meta_id = step 8’s value + 1
    site_id = step 5’s value
    meta_key = site_admins
    meta_value = step 6’s value

    10. Insert a new tuple into wp_sitemeta table with these values:
    meta_id = step 8’s value + 2
    site_id = step 5’s value
    meta_key = yournewdomain.com
    meta_value = NULL

    11. Insert a new tuple into wp_sitemeta table with these values:
    meta_id = step 8’s value + 3
    site_id = step 5’s value
    meta_key = illegal_names
    meta_value = step 7’s value

    12. Go to your new domain to test out if the site worked

    13. Test out the wp-admin of the new domain. Example, http://yournewdomain.com/wp-admin/ <- notice the forward slash at the end, this is important to include otherwise your database won’t be populated correctly (first time accessing wp-admin only, after that you can forget about the last forward slash)

    14. Look at the wp_sitemeta table and make sure a bunch of new entries were created in the database, this means everything worked.

    15. Lastly, update your database with the url of the new domain:
    UPDATE wp_#_posts SET guid = REPLACE (
    guid,
    'http://exampleoldsiteurl.com',
    'http://examplenewsiteurl.com’;

    and

    UPDATE wp_#_posts SET post_content = REPLACE (
    post_content,
    'http://oldsiteurl.com',
    'http:// newsiteurl.com’;

    Where # is the blog_id value from step 5
    References:
    http://bui4ever.com/2007/06/wordpress_mu_with_domain_mapping/
    http://bavatuesdays.com/multiple-domains-on-wpmu-mission-accomplished/
    http://welcome.totheinter.net/2009/05/06/changing-wordpress-mu-from-subdomains-to-subdirectories/
    http://codex.wordpress.org/Changing_The_Site_URL#Domain_Name_Change

    Thanks to Matt & Chaz from our group. 10 Mt. Dews and 6 hours later we were good to go.

About this Topic

  • Started 14 years ago by tomaltman
  • Latest reply from tomaltman