• Resolved hootproof

    (@hootproof)


    Hi guys,

    I have been trying to setup the MU Domain Mapping Plugin (https://www.ads-software.com/plugins/wordpress-mu-domain-mapping/installation/) for my subdirectory WordPress multisite network.

    So far, I’ve got the following:
    – the multisite runs on maindomain.com
    – it has several sites run in a subdirectory, such as maindomain.com/child
    – I want to map childomain.com to the site maindomain.com/child
    – I installted the domain mapping plugin according to the instructions and mapped childdomain.com to the IP address where the multisite runs

    .htaccess of the multisite installation:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) /wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) /wordpress/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ /wordpress/$2 [L]
    RewriteRule . index.php [L]

    wp-config:

    <?php
    // credentials and salts...
    
    /* Multisite */
    define( 'WP_ALLOW_MULTISITE', true );
    
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'maindomain.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    
    define( 'SUNRISE', 'on' );
    
    require_once(ABSPATH."wp-settings.php");
    ?>

    The main site works fine now, as well as it’s backend and the network admin. When I go to either childomain.com or maindomain.com/child however, it results in a redirect loop.

    I’ve tried various things with the domain itself, including CNAME (maindomain.com), IP address, HTTP redirect…

    Does anyone have an idea of how to fix this? I’ve already tried some of the proposed solutions in other threads (altering the .htaccess etc.), but they didn’t work. Any help would be greatly appreciated!

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

    (@wpmuguru)

    Domain mapping requires no changes to your .htaccess.

    It sounds like the redirect loop might be coming from your web server config. Can you describe how you set that part up?

    Thread Starter hootproof

    (@hootproof)

    Hi Ron,

    thank you for your reply!

    Apparently, the hosting provider was a bit strange in this regard (hostpoint.ch). I tried several settings, including pointing childdomain.com to the IP address of the multisite, using a CNAME record and even with an HTTP redirect.

    Nothing worked, because hostpoint.ch requires the creation of “websites” (records) that sort of create a connection between a domain and an actual directory on the server. So if you just point a domain to an IP address or directory without creating such a “website”, it won’t work no matter what. I think that’s pretty strange but in the end we got it to work.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirect loop in frontend / Subdirectory install’ is closed to new replies.