The MU forums have moved to WordPress.org

WordPress MU Domain Mapping - Can't login to sites. Just redirects. (33 posts)

  1. dotbeta
    Member
    Posted 14 years ago #

    I am having trouble with this program. I cannot login to any of the "sites" I make with a mapped domain, the url simply redirects me back to the login every time I try to login. If I input an incorrect user/pass it gives an error, if it's correct it simply redirects me.

    My Current Setup :

    +I setup Wordpress MU. Create a new "blog", sub.domain.com.
    +I go to blogs, edit, change all sub.domain.com to sub.com/
    +I add the domain to my cpanel and make sure the DNS points to the IP Address for my host and the directory for the domain points to domain.com (the Wordpress MU installation)
    +I setup a Wildcard DNS for domain.com where *.domain.com all point to the same directory. This all works fine

    If I go to sub.com, everything works just fine. It shows the new blog, I can navigate all of the pages just fine. If I log in, it takes me to the sub.com/login page. If I try to login it just redirects me!

    I've tried a ton of hack and slash fixes I've read through the tons of threads around the web, including here, to no avail. Am I missing a step to bypass this loop?

  2. andrea_r
    Moderator
    Posted 14 years ago #

    Yeah, a domain mapping plugin. First off, it will shorten step 2 on your list.

    Also, if you point domain #2 at your IP address, then your IP address should show your MU install. If it doesn't that's part fo the issue too.

  3. dotbeta
    Member
    Posted 14 years ago #

    Yeah it does show the MU install just fine. Even further, it shows the MU installation and the new blog I created on it. So it shows the new blank blog I created for that domain. That part is working just fine.

  4. andrea_r
    Moderator
    Posted 14 years ago #

    you may have to edit the config file to comment out the domain cookie lines.

  5. andrea_r
    Moderator
    Posted 14 years ago #

    you may have to edit the config file to comment out the domain cookie lines.

  6. dotbeta
    Member
    Posted 14 years ago #

    I edited out the auth lines with no luck.

    I don't have any other cookie lines

    I also commented out the domain_current_site piece because I read I had to do that. What cookie line am I missing?

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

    /**#@+
    * 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', 'fc1b7b91a30fb930bb589011182c35e025aad4bf527b41a6fc51ad3ffbba7bce');
    define('SECURE_AUTH_KEY', '616eb71b6e1287b4c1c5482cd561b2800871e2d013b8d3583b1f52d1354da9b6');
    define('LOGGED_IN_KEY', 'de1aef4a0cb628dab340528fa1cc17ce94d393bc30edb501dc508005211fc61b');
    define('NONCE_KEY', 'a31394162fd4084b8f62af8549933e79b01781b9d4252f16522dc134567325d5');
    define('AUTH_SALT', '50cd587400c45fe7ffe03b73d36913b250d67617e2851230afdabd8ee32513bb');
    define('LOGGED_IN_SALT', '2e3d072525b7363db8933fb4802b160ddaba0ccfce9d64ad1d2978665cc1e0b4');
    define('SECURE_AUTH_SALT', '23ce74f4eaeb03892be8c9254762be3117ccc30b5cd792a614126f4892fd8190');
    /**#@-*/

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

    /* That's all, stop editing! Happy blogging. */

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

  7. dotbeta
    Member
    Posted 14 years ago #

    Any luck anyone?

  8. andrea_r
    Moderator
    Posted 14 years ago #

    You're using cpanel - did you actually go in there and Park domain2 on top of domain 1?

  9. dotbeta
    Member
    Posted 14 years ago #

    Yes. I went into cpanel and made it an addon domain pointing to the same directory as the MU installation. Thats why the blog actually works. It is only the admin area that creates a loop that doesnt work.

    Did you see the cookie line in what I pasted that I should try to comment out or is that not for my version?

  10. andrea_r
    Moderator
    Posted 14 years ago #

    "I went into cpanel and made it an addon domain pointing to the same directory as the MU installation"

    In theory that sounds like it should work, but in actuality, you can see it does not.

    undo what you did, and park it instead.

  11. dotbeta
    Member
    Posted 14 years ago #

    Ok it is now parked. I can navigate the site just the same as before so there was no loss in access at all but it still causes a loop when I attempt to login and takes me right back to the login page.

  12. andrea_r
    Moderator
    Posted 14 years ago #

    Did you put a trailing slash in when you mapped the domain? If so, take it out.

  13. dotbeta
    Member
    Posted 14 years ago #

    It only allowed me to add a domain to domain mapping with a trailing slash. I went into phpadmin and removed it and now it lets me login. But all of the sites only mirror the original wordpressmu page. The backend logs in to the original site as well.

    Even though it says sub.com and all of the links say sub.com, all subs show domain.com. I'm going to try the "addon" technique again to see if it goes back to working right.

  14. andrea_r
    Moderator
    Posted 14 years ago #

    Ugh, normally it is not this difficult. No idea what's going on.

  15. dotbeta
    Member
    Posted 14 years ago #

    I know what you mean. I've gone through TONS of support threads and it's always like one little hiccup and then everythings fine. This has been the oddest experience and from what I can tell, it's out of the norm.

    How it works now is this.

    domain.com has the mu installed.
    sub1.com points to the mu directory.
    mu installation has sub1.com added as a "blog"
    within MU, I have sub1.com as the domain info under edit blog, instead of sub1.domain.com.

    sub1.com is added with no trailing slash using domain mapping.

    now sub1.com, sub2.com, sub3.com all show the core domain.com pages, and when you login, it takes you to the domain.com admin despite the url being sub*.com.

    Let me see if I have something wrong with my dns settings.

  16. dotbeta
    Member
    Posted 14 years ago #

    Ok, fresh install, still no work.

    Here is every step I took.

    Setup MU for subdomains.
    Add blog, sub1.com. Change all urls to be sub1.com instead of sub1.domain.com.
    Park sub1 on main domain.

    At this point, the site works. Each domain points to their correct domain. sub1.com points to sub1.com blog, sub2.com points to sub3.com, everything is fine

    If you login, it redirects to login page and you cant move further, this was the previous issue.

    I install Domain Mapping plugin, save the server IP.

    Config is not altered except to uncomment sunrise.
    define('DOMAIN_CURRENT_SITE', 'domain.com' ); is still uncommented.

    Everything is still fine.

    If I try to add a domain to the domain mapping tool, I have to put a trailing slash/ or else it wont add anything.

    now if I go to domain.com, it automatically redirects to sub1.com, I can no longer access domain.com. Thats fine as I assume it is an error if you have a trailing slash. I go to php admin, remove trailing slash...

    now mir-3.com automatically takes me to domain.com admin!

  17. dotbeta
    Member
    Posted 14 years ago #

    Ok, I found a temporary work around that I can do, but it is unacceptable.

    I have to add the site with domain mapping with the trailing slash.

    If I go to the url and login, it takes me to the domain.com admin area but shows the url as the sub1.com admin. If I go to domain mapping in there and delete the sub1.com record from the plugin, now I am logged into the admin area for sub1.com. I cannot logout though.

    This is too weird :(

    Anyone?

    I'm ALMOST there.

  18. andrea_r
    Moderator
    Posted 14 years ago #

    Okay, part of your problem here is you are editing the blog settings and then domain mapping it. Do not do that - let the domain mapping plugin handle it.

    Just create a new blog sub1.domain.com. then go to the backend of that blog and use the domain mapping menu. that's it.

  19. Taffman
    Member
    Posted 14 years ago #

    I have an associated problem.

    I have just installed a new version og Wordpress MU as a subdirectory i.e.

    domain.com/blogs

    I attempt a login from the install script, I enter username and password then get:

    The page isn't redirecting properly

    redirected URL is:

    http://domain.org/blogs/wp-login.php?redirect_to=http%3A%2F%2Fdomain.org%2Fblogs%2Fwp-admin%2F

    Anyone have any idea whats going on here as I cant log in as admin.

  20. tim.moore
    Member
    Posted 14 years ago #

    Do you have WordPress or WordPress MU installed in the root of your server?

  21. Taffman
    Member
    Posted 14 years ago #

    Wordpress MU, but not in root, in ../blogs/

  22. Taffman
    Member
    Posted 14 years ago #

    Interesting, problem only exist with firefox. Chrome works fine ?????

  23. Taffman
    Member
    Posted 14 years ago #

    Ok so now Firefox is working now. Must have been a server glitch. Sorry to have wasted everyone's time :-(

  24. tim.moore
    Member
    Posted 14 years ago #

    Yeah, sometimes cookies in your browser screw things up. I've spent time thinking I had a bad install only to find out it was Firefox's cookie management that was pooched.

  25. DeannaS
    Member
    Posted 14 years ago #

    I'm dealing with the same thing right now. Worked. Didn't work. I hate trying to debug that sort of issue. Be consistent already! ;)

  26. dotbeta
    Member
    Posted 14 years ago #

    All fixed!

    What you have to do, which I have never explained anywhere, is setup the domain mapping IN THE SUB BLOG.

    Once you create a new blog, login to the backend of that new blog, from THERE go to the domain mapping and add the "domain" name of it.

    Then it works just fine!

  27. DeannaS
    Member
    Posted 14 years ago #

    Yah, my problem was even more stupid. You know that part about commenting out the vhosts line in the wp-config file? Yah, well, really. You really do have to do that. And the fact that it _used_ to be commented out but you uncommented it when you were testing something else? Yah, that doesn't really help. ;P

  28. andrea_r
    Moderator
    Posted 14 years ago #

    dotbeta - you said"What you have to do, which I have never explained anywhere, is setup the domain mapping IN THE SUB BLOG."

    And earlier I said

    "Just create a new blog sub1.domain.com. then go to the backend of that blog and use the domain mapping menu. "

  29. chrisbeee
    Member
    Posted 14 years ago #

    The advice about logging into the backend of a sub-blog is funny to me, because the whole topic - as I understand it - is that when you try to login to a sub-blog, it throws you back out - cannot login. That is what I am experiencing.

  30. andrea_r
    Moderator
    Posted 14 years ago #

    After you domain mapped it? Because the instructions I gave were for before you mapped it.

    If you're being redirected on login to a *mapped* domain on the sub-blog, that's a different issue.

About this Topic

  • Started 14 years ago by dotbeta
  • Latest reply from andrea_r