Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • I made a typo in the name of the file in my previous post.
    It should be named: “disable-canonical-redirects.php
    (remove the “s” from .phps)

    Regards

    This is obviously just another ongoing unresolved issue that keeps coming up.

    I found this solution buried in a forum post from some time ago and it worked for me. If you dig deep enough and long enough you may find the original post.

    Plugin Name: Disable Canonical URL Redirection
    Create a file with the name “disable-canonical-redirects.phps”
    Copy the code into it:

    <?php
    /*
    Plugin Name: Disable Canonical URL Redirection
    Description: Disables the "Canonical URL Redirect" features of WordPress 2.3 and above.
    Version: 1.0
    Author: Mark Jaquith
    Author URI: http://markjaquith.com/
    */
    remove_filter('template_redirect', 'redirect_canonical');
    ?>

    Place the file in the plugins directory and activate it in the admin section of the plugins.

    I don’t think this plugin is even listed in the plugins or talked about in any help catagories.

    I needed it for both 2.8.6 and again with 2.9
    Probably would fix issues with previous versions as well but the first one I ever installed was 2.8.6.

    Regards.

    Thread Starter glenara

    (@glenara)

    exit('<script type="text/javascript">window.location.assign("'.$redirect_to.'");</script>');
    Thread Starter glenara

    (@glenara)

    Update:
    In the side bar of this post it refers to WordPress version 2.8.5 which is not correct. The version I installed is 2.8.6

    Also since manually refreshing the page to login and logout is a bit of a nuisance I’ve revised the exit code to do the refresh automatically.

    Instead of the original post which was:
    exit("<div style='text-align:center; color:red;'>Click refresh to continue...<br />$redirect_to</div>");
    Use this instead:
    exit('<script type="text/javascript">window.location.assign("'.$redirect_to.'");</script>');
    Replace it in both the logout and login sections. Now you won’t have to refresh the page after you click the login or logout buttons.

    My original php version was 5.2.2 and have since upgraded to php 5.2.12
    The problem still exists in php 5.2.12 so I think it safe to say this isn’t a php bug or issue.

    Regards.

    I just installed WordPress for the first time and I am completely amazed at all the problems. Same issues, release after release which are tagged in the forums as resolved.

    Initially my pages didn’t even show up until I found this plugin (which of course isn’t even listed in the plugins).
    Plugin Name: Disable Canonical URL Redirection
    http://txfx.net/files/wordpress/disable-canonical-redirects.phps

    As for the logging in issue, what is happening is that the cookies are not being sent with the header redirection.

    Many users have also indicated that their installation worked fine for a few months before this error started occurring. Which I’m sure was a result of clearing or deleting their cookies (because they were never actually logged out).

    Once you do get logged in, you may also have noticed that when you logout you are not actually logged out. After you have clicked the logout link you are redirected back to the login page (which is what should happen). If you simply change wordpress/wp-login.php to wordpress/wp-admin/ in the address bar, you are logged in with out having to provide any credentials. This to is a result of the logout redirection header not sending the cookies to destroy the cookies in the browser.

    The code I have included here is nothing less than a hack but does force the cookies to be sent which in turn allows you to log in and out correctly.

    In wp-login.php:
    first go to the case ‘logout’ : section and add

    if ( isset($_COOKIE[TEST_COOKIE]) ) {
      if($_COOKIE[TEST_COOKIE] == "set")  { //LOGGED_IN_COOKIE
      setcookie(TEST_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);
      exit("<div style='text-align:center; color:red;'>Click refresh to continue...</div>");
      }
    }
    wp_safe_redirect($redirect_to);

    Then locate the case ‘login’ : section and add

    if ( isset($_COOKIE[TEST_COOKIE]) ) {
      if($_COOKIE[TEST_COOKIE] != "set")  {
        setcookie(TEST_COOKIE, 'set', 0, COOKIEPATH, COOKIE_DOMAIN);
        exit("<div style='text-align:center; color:red;'>Click refresh to continue...<br />$redirect_to</div>");
      }
    }
    wp_safe_redirect($redirect_to);

    Note: new code is the stuff above the line containing:
    wp_safe_redirect($redirect_to); in both cases.

    As I said this is a Hack but until the developers fix it properly you will be able to log in and out properly.

    So far the 5 minute install is in excess of 40 hours.

    I also installed MovableType. After I upgraded the required perl modules it was up and running perfectly.

    Although I prefer the PHP environment over Perl, from what I have read in the forums about ongoing unresolved issues release after release and some in excess of a year I find myself “HardPressed to recommend WordPress” to any body.

    Hopefully this Hack will allow some of you to login.

    Regards

    Thanks for the link. Why isn’t this plugin listed in the WordPress plugins, or at least I couldn’t find it.

    This error is occurring is version 2.8.6 as well. This is clearly a bug and shouldn’t have to be a plugin.

    The 5 minute install to-date has taken about 40 hours and still can’t login properly without using a temporary hack. It keeps returning to the login page even though the credentials are correct. (the login cookies are not being sent with the header redirection)

    Regards and thanks for the link.

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