WordPress.org

Support

Support » Plugins and Hacks » Multiple domains with multisite and root domain not in WordPress

Multiple domains with multisite and root domain not in WordPress

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Ron Rennick
    Participant

    @wpmuguru

    Thanks Ron for the answer… does it mean that it’s a known “issue” of the plugin in the current version of WordPress?

    If so any other way around I could have my scenario up and running?
    Appreciate it,

    Thanks!

    Patrick Daly
    Member

    @developdaly

    Yes, it’s a known issue with 3.5. The plugin simply doesn’t support multisite in a subdirectory since that’s a new feature of 3.5.

    Ok thanks guys… trying to find a way around, I changed a bit the setup.

    http://www.example.com (still the main non-wordpress site)

    I got WordPress installed this time under:
    blogs.example.com and I can activate successfully the plugin.

    Did the subdirectory installations so I have:

    blogs.example.com
    blogs.example.com/fr/
    blogs.example.com/de/

    Now I’d like to map the http://www.example.fr/blog/ to blogs.example.com/fr/ etc. etc.
    What I found out so far is:

    1) the main blog has a permalinks structure different from the child sites (it includes the /blog/ folder)

    blogs.example.com/blog/2013/01/15/sample-post/
    blogs.example.com/fr/2013/01/15/sample-post/

    2) trying to mapping the domain… I have to use http://www.example.fr (doesn’t work with http://www.example.fr/blog/) but even like that I manage to go to the proper domain, the content load properly but all the other files etc. are being loaded from:

    http://www.example.fr/wp-content/...
    instead of
    http://www.example.fr/blog/wp-content/...

    Any better way of doing the whole scenario?

    Thanks for the help again.

    Plugin Author Ron Rennick
    Participant

    @wpmuguru

    You cannot map paths. The domain itself has to be mapped because DNS lookup looks for the domain not the path.

    Here’s how I resolved my case, without using the plugin (maybe will be useful for the next version)…

    So the way I setup the whole thing…

    blogs.example.com is pointing to the wordpress installation and from here I do the whole setup and activate Multisite. (in this way I can enable the Sub-domains option). Once that is done, you should be able to have something like:

    site1.blogs.example.com

    site2.blogs.example.com

    etc.

    if everything is up and running fine the next step is the mapping itself.

    Login into the db and change “Home” and “Site URL”. The Multisite installation create lots more table than the standard one, in the specific for each site you should have something like: wp_1_options, wp_2_options and so on… in here change the value for siteurl and home to be what u wish. (in my case the value are http://www.example.fr/blog – no trailing slash!)

    Also you have to change the wp_blogs table, in the specific the domain and path value. (again in my case domain= http://www.example.fr, path=/blog)

    Once you done that, you should have all the different sites under their own domains. But there’s one last step…

    The Admin panel won’t work and you may have all the resource files (css, js etc not loading from the correct path).

    First in your wp-config.php

    define(‘MULTISITE’, true);
    define(‘SUBDOMAIN_INSTALL’, true);
    define(‘DOMAIN_CURRENT_SITE’, ‘blogs.example.com’);
    define(‘PATH_CURRENT_SITE’, ‘/’);
    define(‘SITE_ID_CURRENT_SITE’, 1);
    define(‘BLOG_ID_CURRENT_SITE’, 1);

    You have to change this line define(‘DOMAIN_CURRENT_SITE’, ‘blogs.example.com’); and set the value to

    define(‘DOMAIN_CURRENT_SITE’, $_SERVER['HTTP_HOST']);

    Last but not least what the .htaccess looks like:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    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 ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    </IfModule>
    # END WordPress

    Patrick Daly
    Member

    @developdaly

    Ron, any plans to work domain mapping for WordPress multisite in a subdirectory into a new version?

    Plugin Author Ron Rennick
    Participant

    @wpmuguru

    @patrick – the dev version supports WP installed in its own folder.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Multiple domains with multisite and root domain not in WordPress’ is closed to new replies.