WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
Multiple domains with multisite and root domain not in WordPress (9 posts)

  1. joe.maffia
    Member
    Posted 1 year ago #

    Hi all,
    I've been searching around for son answers but don seems to ding a final one.

    I have http://www.example.com (running on different platform / different server) then:

    http://www.example.com/blog/
    http://www.example.fr/blog/
    http://www.example.de/blog/
    all pointing to the IP address where wordpress is installed (in the root folder of apache)

    I did the multisite setup with subdirectory option and I currently have:

    http://www.example.com/blog/fr/
    http://www.example.com/blog/de/

    As you can imagine I would like to have http://www.example.fr/blog/ pointing to http://www.example.com/blog/fr/

    I tried playing around with the plugin but first... didn't let me install the subdomain option 'cause was recognising my installation as it was running from a folder. So I went for the subdirectory option... but still doesn't let me edit the domain for each blog for the same reason/issue. (Giving the same error/warning message)

    WordPress is definitely installed on the htdocs/ but seems the plugin see the url http://www.example.com/blog/ and think it's under a folder :(

    I do had this rule (so apache wasn't going to look for wordpress under the /blog/ folder that doesn't exist)

    Options +FollowSymlinks
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^blog/(.*)$ /$1 [L]
    </IfModule>

    Any help?
    Thanks a lot!

    http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

  3. joe.maffia
    Member
    Posted 1 year ago #

    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!

  4. Patrick Daly
    Member
    Posted 1 year ago #

    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.

  5. joe.maffia
    Member
    Posted 1 year ago #

    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.

  6. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

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

  7. joe.maffia
    Member
    Posted 1 year ago #

    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
  8. Patrick Daly
    Member
    Posted 1 year ago #

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

  9. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    @Patrick - the dev version supports WP installed in its own folder.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic