WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
[resolved] Redirect loop on backend home page (13 posts)

  1. rmose
    Member
    Posted 2 years ago #

    Current Setup
    WordPress 3.3.1, network/multisite with subdirectories
    WordPress MU Domain Mapping 0.5.4.2
    No boxes are checked under "Domain Mapping".
    No domains are currently mapped.

    When network activating the plugin, the message below is displayed at the top of the page. Is there any way to see the additional output?

    "The plugin generated 167 characters of unexpected output during activation..."

    Before mapping any domains, I visited the main website to confirm that everything still worked. That resulted in a looping redirect with the browser giving up. The log file contains lines like the following.

    http://wp.example.com/
    http://wp.example.com/blog
    http://wp.example.com/blog/blog
    http://wp.example.com/blog/blog/blog
    and so on, ever increasing in length

    Going to another site, such as the following, works without issue.
    http://wp.example.com/site1/
    http://wp.example.com/site2/

    Going to http://wp.example.com/wp-login.php works fine, as well. I can login as the administrator, and I'm placed in https://wp.example.com/blog/wp-admin/. It appears that the looping only occurs when visiting the main site home page http(s)://wp.example.com/.

    There are no SEO plugins installed. In fact, there are relatively few plugins installed. It looks like WP is attempting to redirect the main site to wp.example.com/blog internally, as it normally does on a multisite with subdirectories, but something is interfering with that process and causing a loop. I believe everything is correctly configured as described in the installation notes and suggested web page.

    Is this a known issue? If yes, is there a way to correct it? If not, can someone describe in a little more detail what you believe is happening internally? That might give me some clues about what to do next. Thanks for your insight.

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

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    The plugin generated <some number> characters of unexpected output during activation...

    That message is usually a result of a plugin being corrupted during installation.

    Remove the domain mapping plugin and sort out the issue with the redirects before re-installing any plugins.

  3. rmose
    Member
    Posted 2 years ago #

    My original message might not have been clear. At this time, the domain mapping plugin appears to be the source of the redirect looping. The problem occurs when the plugin is activated and goes away when the plugin is deactivated.

    So, sorting out the issue of the redirects means installing and activating the domain mapping plugin and then doing some debugging. That was in the plan all along. One reason for this post is to glean details about the inner workings of the plugin to hopefully shorten the time it takes to debug this issue. Any pointers would be appreciated.

  4. rmose
    Member
    Posted 2 years ago #

    The unexpected output during activation is not the result of corruption. The message is below. It is attempting to check if the current version of WP is 2.9.2.

    Notice: Undefined variable: wp_version in ~/wp-content/plugins/wordpress-mu-domain-mapping/domain_mapping.php on line 683

  5. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Check to see if it's $wp_version or wp_version. The code that should be in the zip is $wp_version.

    http://plugins.trac.wordpress.org/browser/wordpress-mu-domain-mapping/tags/0.5.4.2/domain_mapping.php?rev=493262#L683

    $wp_version is a global variable.

  6. rmose
    Member
    Posted 2 years ago #

    Line 683 is the same as the link you provided. The code has not been modified since installation.

    if ( $wp_version == '2.9.2' ) {

  7. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    You can probably eliminate that activation error by adding a

    global $wp_version;

    after the */ at the the of the copyright notice. It's been a couple years since the last time, but I have seen a couple servers that blocked access to global variables without having an explicit global declaration for them.

    For the rewrite issue, what are the permalinks set to on the main site?

  8. rmose
    Member
    Posted 2 years ago #

    Explicitly adding "global $wp_version;" at the top eliminated the message about extra characters being generated after activation.

    Permalinks are set to use day and name. The blog page is named Blog. The sample permalink is

    http://wp.example.com/blog/blog/2012/01/26/sample-post/

    A static page is selected as the home page, and the Blog page is currently set to private. The permalink for the home page is

    http://wp.example.com/blog/

  9. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    The permalink for the home page is

    http://wp.example.com/blog/

    That's your issue - Domain mapping only works with WP installed in the root of the website.

  10. rmose
    Member
    Posted 2 years ago #

    The installation instructions clearly state that giving WordPress its own directory does not work with multisite enabled. See the following link.

    http://codex.wordpress.org/Create_A_Network#WordPress_Settings_Requirements

    The blog slug is automatically used by WordPress for the main site in a multisite install using subdirectories to prevent collisions. The blog slug is clearly mentioned below.

    http://codex.wordpress.org/Create_A_Network#Permalinks

  11. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    The blog slug is not used for the home page of the site. It is added to the beginning of the permalinks to your categories, tags & posts.

    You can create a network when WP is installed in a folder. What you can't do is create a network when the install in a folder and have made the changes so that the site appears in the root of the website.

    IF WP is installed in the root of your website, how did you get the home page to be /blog?

  12. rmose
    Member
    Posted 2 years ago #

    IF WP is installed in the root of your website, how did you get the home page to be /blog?

    That's an interesting question. There is no blog directory on the server and never was. WordPress was at the root of the website from the start. It seems like something went wrong during installation that caused the main site to be named "blog". I didn't think that was possible for multisite.

    I'll blow away the database and do a reinstall. If the blog slug is causing the looping, then a reinstall should take care of it. I'll post the results.

  13. rmose
    Member
    Posted 2 years ago #

    I am happy to report that after deleting the database and installing a fresh copy of 3.3.1, the domain mapping plugin is working perfectly in multisite mode. It is still a mystery how "blog" became part of the main site URL. Thanks, Ron, for pointing that out, because that was the issue.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic