WordPress.org

Ready to get started?Download WordPress

Forums

WordPress HTTPS (SSL)
[resolved] Login subdomain (14 posts)

  1. staze
    Member
    Posted 3 years ago #

    Maybe this has been covered, but I can't seem to find anything on it.

    My site is http://www.example.com, but I'd like the login page to exist at https://secure.example.com, then once logged in, it kicks me back to http://www.example.com/whatever, logged in.

    I can't seem to get this to work. I've put in Shared ssl to secure.example.com, and turned on FORCE_SSL_LOGIN, and when I got to login, it does indeed kick me to secure.example.com, but after logging in, it tries to kick me to https://www.example.com, rather than http://www.example.com, so I get a "server not found".

    Any ideas?

  2. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Hi staze,

    It took me a while to figure out, but this feature has been added in version 1.9. Let me know if you get it working.

    Thanks,
    Mike

  3. staze
    Member
    Posted 2 years ago #

    Mike,

    What settings are used for this? I've enabled and set shared SSL to be "https://admin.example.com", and then enabled "force shared ssl admin", but I don't see any change.

    Thanks!

  4. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Hey staze,

    That should be all you have to do. If it's not working, you can post or email me the link at mike[at]mvied[dot]com and I can take a look at why it's not redirecting properly. I may need to login to the site as an admin to test bug fixes for the plugin. It's understandable if you're not comfortable with that, but I'd really like to help.

    Thanks,
    Mike

  5. staze
    Member
    Posted 2 years ago #

    Mike,

    Here's one culprit....

    [Tue Jul 19 10:02:34 2011] [error] [client 67.171.240.215] PHP Warning: Cannot modify header information - headers already sent by (output started at /Library/WebServer/Documents/example.com/wp-content/plugins/wordpress-https/wordpress-https.php:453) in /Library/WebServer/Documents/example.com/wp-content/plugins/wordpress-https/wordpress-https.php on line 454

    Wonder if it's stepping on w3tc's toes...

  6. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Hmm, that's right before the redirect.

    Try adding ob_start(); after while(@ob_end_flush());.

    If that doesn't work, try changing while(@ob_end_flush()); to while(@ob_end_clean()); without ob_start(); after it. If that doesn't work, try it with ob_start(); after it.

    Let me know if any of that works.

    Thanks,
    Mike

  7. staze
    Member
    Posted 2 years ago #

    So, "while(@ob_end_clean());" allowed the admin page to load, though not really completely (missing CSS, etc). After logging in, I get a cannot connect because it seems the redirect_to isn't being set correctly.

    https://admin.example.com/wp-login.php?redirect_to=http%3A%2F%2Fwww.example.com%2Fwp-admin%2F&reauth=1

    The CSS not loading seems to be because looking at the code at least, it's trying to load them from https://www.example.com rather than https://admin.example.com.

    Thanks for helping out on this... we'll get it!

  8. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Try taking the redirect_to out of the URL and trying it. So, just https://admin.example.com/wp-login.php.

    Also, I just fixed the CSS not loading issue for another user, so I'll be pushing out a bug fix release today that should take care of that.

  9. staze
    Member
    Posted 2 years ago #

    Not that easy, I'm afraid. It logs in, but I get a page not found, because the submit button code looks like:

    <p class="submit">
    <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="Log In" tabindex="100" />
    <input type="hidden" name="redirect_to" value="https://www.example.com/wp-admin/" />
    <input type="hidden" name="testcookie" value="1" />
    </p>

    So we'd need to rewrite that with the plugin, I'm assuming, to be:

    <p class="submit">
    <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="Log In" tabindex="100" />
    <input type="hidden" name="redirect_to" value="https://admin.example.com/wp-admin/" />
    <input type="hidden" name="testcookie" value="1" />
    </p>
  10. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    I see. I believe my bug fix version will fix this as well.

    Replace the contents of wordpress-https.php with the code here. http://mvied.com/wordpress-https.txt

    Let me know if that fixes it.

  11. staze
    Member
    Posted 2 years ago #

    Hmm... it the fixed the css, but the submit button still has www, and the redirect in the url still has www. =/

    the loginform is accurate though.

    So it's kind of odd. If you remove the bad "redirect_to" in the url, you get the wp-login.php page at https://admin.example.com, you try to login, and you get bounced to http://www.example.com/wp-admin, which then bounces you to admin.example.com/wp-login.php again, with the bad redirect_to. rinse, repeat.

    As another side note, the "back to sitename" at the bottom of the login page shows the subdomain (admin.example.com) rather than the real site (www.example.com).

    Let me know if you need more info.

  12. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Do you mind if I take a look at it? If you don't want it public you can email it to me.

  13. staze
    Member
    Posted 2 years ago #

    emailed. Will make sure to post back to this thread once we have some results.

  14. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    The issue seems to be the strange login bug that has yet to be fixed. I believe it has something to do with logging into the admin panel using the Shared SSL URL for the first time. Then again, I've had others report the problem that aren't using Shared SSL. It's certainly something I'm aware of and trying to fix.

    In the meantime, resetting your cookies will allow you to log in again.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic