WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: WordPress MU Domain Mapping] can't visit mapped blog admin pages (15 posts)

  1. Jason Lemahieu (MadtownLems)
    Member
    Posted 3 years ago #

    I have the plugin set up and a blog mapped, and it works perfectly for everything when you're not logged in. yay!

    However, having major issues with the backend. Well, just 1 issue I guess: I can't get to it!

    Regardless of the options checked on the Domain Mapping options screen, I can not access the backend of a mapped blog. I am instead displayed the login screen.

    Example:
    http://www.foo.com/bar is my blog installed as a subdirectory
    http://www.bar.com is my other domain.

    Behavior:
    http://www.bar.com displays my foo.com/bar site perfectly.
    bar.com/wp-admin redirects me to foo.com/bar/wp-login.php
    Submitting my login info takes me to:
    foo.com/bar/wp-login.php?redirect_to=http://foo.com/bar/wp-admin/profile.php

    *however* at this point, at least part of WP thinks I'm actually logged in, because if I go back to bar.com, my "Site Admin" link shows up (which only does if you're logged in)
    Clicking on that Site Admin link however, will take me to the login page.

    Similarly, if I log in at just foo.com, go to Blogs, and try to visit the backend of foo.com/bar via the Backend link, it will take me to the login page at:
    foo.com/bar/wp-login.php?redirect_to=http://foo.com/bar/wp-admin

    Things to note:
    I've checked at pretty much every stage of the process, and almost never see a record in wp_domain_mapping_logins. I can't even consistently reproduce it, but occasionally after doing a bunch of stuff I find one weird record: id=NULL, userid=0, blogid = bar's blogid. t: 1/1/0001 12:00:00 AM
    I never get the message: "Incorrect or out of date login key"
    I do NOT define DOMAIN_COOKIE in my wp-config

    Relevant?
    When I log in at foo.com/wp-admin, there are 5 cookies set when i get to the dashboard:
    wordpress_
    wordpress_logged_in_
    wordpress_test_cookie
    wp-settings-1
    wp-settings-time-1

    When I log in at foo.com/bar/wp-admin, there are 2 cookies set when i get bounced back to the login page
    wordpress_logged_in
    wordpress_test_cookie

    Questions:
    I did try a much earlier version of the plugin with the same name first, which didn't work. I deleted the domain_mapping table in order to get this one working. Could there be any global options stored in the DB that are conflicting with this version that I could look for and purge?

    Any ideas how to fix this, or what I can do to get more debugging information?
    Thanks! :D

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

  2. Have you tried the trunk version of the plugin? :)

    Before you mapped the sub-blog, you could login & access the backend fine, correct?

  3. Jason Lemahieu (MadtownLems)
    Member
    Posted 3 years ago #

    I am using 0.5.1 - is there a newer version?

    And yes, was able to log in and access the backend fine before mapping.

  4. Try this one:
    http://plugins.trac.wordpress.org/browser/wordpress-mu-domain-mapping/trunk/domain_mapping.php?rev=235858

    Also note the login redirect is stripping off the www. That would probably be it.

  5. Jason Lemahieu (MadtownLems)
    Member
    Posted 3 years ago #

    Tried that one - no more luck. However, I've realized that since I've installed this, my whole site is bonked. I can't go to the backend of ANY blog, even ones I hadn't mapped. I deleted the plugin, deleted sunrise.php, returned wp-config.php to its original state, and i STILL can't view the backend of any blog.

    On an even weirder note, I tried installing this on another WPMU site earlier this morning, and had the same problem. However, now that one is magically working perfectly on that server!

    So thanks for looking at this. Let me try to un-break my site without the plugin, then I'll give it a fresh go. :)

    Thanks!

  6. Jason Lemahieu (MadtownLems)
    Member
    Posted 3 years ago #

    Okay, THOUGHT the issue was resolved, but it was in fact only 'resolved' so long as I had an existing session when I re-installed the plugin.

    If I'm logged in when i install the plugin, I can keep editing site backends. If I log out, however, I can no longer get to any (non-main) blog's backend after I log back in. :(

    also, whenever I map, then un-map a blog, all the Single posts give me 404s. (archives and Pages work)

    blargh... back to more research/testing/head-banging :)

  7. DeannaS
    Member
    Posted 3 years ago #

    Andrea - it's not the www issue. We're not really using www. It's actually subdomains. So:

    Real site:
    counties.ourdomain.edu/countyx

    Mapped domain:
    countyx.ourdomain.edu

    We also have your version and can go back to messing with that one, too - but that one had fubared all the uploaded images and documents. It wasn't mapping any of those.

  8. Jason Lemahieu (MadtownLems)
    Member
    Posted 3 years ago #

    Just did a fresh wpmu 2.9.1 install with zero plugins. created a subdirectory blog. added domain_mapping plugin. mapped domain.

    exactly the same: works great from front-end, but the same "can't log out and back in" issue for the backend.

  9. Jason Lemahieu (MadtownLems)
    Member
    Posted 3 years ago #

    wpmuguru said I should post this:

    <?php
    /**
    * The base configurations of the WordPress.
    *
    **************************************************************************
    * Do not try to create this file manually. Read the README.txt and run the
    * web installer.
    **************************************************************************
    *
    * This file has the following configurations: MySQL settings, Table Prefix,
    * Secret Keys, WordPress Language, and ABSPATH. You can find more information by
    * visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
    * wp-config.php} Codex page. You can get the MySQL settings from your web host.
    *
    * This file is used by the wp-config.php creation script during the
    * installation.
    *
    * @package WordPress
    */

    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'my_database_name');

    /** MySQL database username */
    define('DB_USER', 'my_username');

    /** MySQL database password */
    define('DB_PASSWORD', 'my_password');

    /** MySQL hostname */
    define('DB_HOST', 'my_host');

    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');

    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    //define('VHOST', 'no');
    $base = '/';
    define('DOMAIN_CURRENT_SITE', 'my.domain.edu' );
    define('PATH_CURRENT_SITE', '/' );
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOGID_CURRENT_SITE', '1' );

    /* Uncomment to allow blog admins to edit their users. See http://trac.mu.wordpress.org/ticket/1169 */
    //define( "EDIT_ANY_USER", true );
    /* Uncomment to enable post by email options. See http://trac.mu.wordpress.org/ticket/1084 */
    //define( "POST_BY_EMAIL", true );

    /**#@+
    * Authentication Unique Keys.
    *
    * Change these to different unique phrases!
    * You can generate these using the {@link http://api.wordpress.org/secret-key/1.1/wpmu/salt WordPress.org secret-key service}
    * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
    *
    * @since 2.6.0
    */
    define('AUTH_KEY', '1');
    define('SECURE_AUTH_KEY', '2');
    define('LOGGED_IN_KEY', '3');
    define('NONCE_KEY', '4');
    define('AUTH_SALT', '5');
    define('LOGGED_IN_SALT', '6');
    define('SECURE_AUTH_SALT', '7');
    /**#@-*/

    /**
    * WordPress Database Table prefix.
    *
    * You can have multiple installations in one database if you give each a unique
    * prefix. Only numbers, letters, and underscores please!
    */
    $table_prefix = 'wp_';

    /**
    * WordPress Localized Language, defaults to English.
    *
    * Change this to localize WordPress. A corresponding MO file for the chosen
    * language must be installed to wp-content/languages. For example, install
    * de.mo to wp-content/languages and set WPLANG to 'de' to enable German
    * language support.
    */
    define ('WPLANG', '');

    // double check $base
    if( $base == 'BASE' )
    die( 'Problem in wp-config.php - $base is set to BASE when it should be the path like "/" or "/blogs/"! Please fix it!' );

    // uncomment this to enable WP_CONTENT_DIR/sunrise.php support
    define( 'SUNRISE', 'on' );

    // uncomment to move wp-content/blogs.dir to another relative path
    // remember to change WP_CONTENT too.
    // define( "UPLOADBLOGSDIR", "fileserver" );

    // If VHOST is 'yes' uncomment and set this to a URL to redirect if a blog does not exist or is a 404 on the main blog. (Useful if signup is disabled)
    // For example, the browser will redirect to http://examples.com/ for the following: define( 'NOBLOGREDIRECT', 'http://example.com/' );
    // Set this value to %siteurl% to redirect to the root of the site
    // define( 'NOBLOGREDIRECT', '' );
    // On a directory based install you must use the theme 404 handler.

    // Location of mu-plugins
    // define( 'WPMU_PLUGIN_DIR', '' );
    // define( 'WPMU_PLUGIN_URL', '' );
    // define( 'MUPLUGINDIR', 'wp-content/mu-plugins' );

    define( "WP_USE_MULTIPLE_DB", false );

    //define('FORCE_SSL_ADMIN', true);
    define('FORCE_SSL_LOGIN', true);

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

  10. Ron Rennick
    MultiSite Guru
    Posted 3 years ago #

    Try turning off the SSL login

    define('FORCE_SSL_LOGIN', true);

    If you are using my DM plugin, sign up to http://musupport.net and ask about it there.

  11. Jason Lemahieu (MadtownLems)
    Member
    Posted 3 years ago #

    We'd tried that earlier, but I just tried it again, and it doesn't change anything. :( See ya at musupport.net :P

  12. Jason Lemahieu (MadtownLems)
    Member
    Posted 3 years ago #

    *believe* the problem was that I'd commented out the VHOST line (like my previous domain mapping plugin wanted). When I uncomment that line, things seem to be working! (for now)

    Thanks so much, guys

  13. We also have your version and can go back to messing with that one, too - but that one had fubared all the uploaded images and documents. It wasn't mapping any of those.

    really? weird, it's supposed to go change everything. We working on a new version, so I'll go double-check that part.

    @madtownlems - so it's working now?

  14. Jason Lemahieu (MadtownLems)
    Member
    Posted 3 years ago #

    Yes! Everything* seems to be working!

    (except for thumb.php dynamic images generated while you have the option set to NOT redirect to original domain. I think I found a fix for it, but just going to use the other option instead.)

    Thanks again for all the help.

    Now to try to write a plugin to hide the Domain Mapping submenu item (under tools) for everyone but siteadmins...

    - MadtownLems

  15. Jason Lemahieu (MadtownLems)
    Member
    Posted 3 years ago #

    submenu hidden for non site-admins! :)
    progress progress go go go!

Topic Closed

This topic has been closed to new replies.

About this Topic