• Resolved hootproof

    (@hootproof)


    Hi guys,

    I have been trying to setup the MU Domain Mapping Plugin (https://wordpress.org/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.

    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 3 replies - 1 through 3 (of 3 total)
  • Hi hootproof, have you tried defining ‘ABSPATH’ ?

    /* 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');
    Thread Starter hootproof

    (@hootproof)

    Thank you for your reply!

    No, I haven’t tried that, but I resolved my issue anyway:

    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!

    Hi, Hootprof

    I have the same issue that you had and stopped at the same point.
    I’m using a shared Godaddy server and the only way to redirect a external domain to Godaddy is creating folders, like hostpoint.ch.
    How do you solved this issue of mapping without crating folders?

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘WordPress multisite domain mapping redirect loop in frontend’ is closed to new replies.