Support » Plugin: Peter's Login Redirect » Redirect loop on certain pages

  • Hello,
    I am trying to repair a site that used your plugin to redirect pages at various stages of a payment process. They have since tried to reroute the payments and so I removed the urls from the plugin settings page. Unfortuantely the redirect seems to be stuck and I can no longer access the homepage or the registration page of the site (I get an infinite loop message. )

    I have tried the following:

    • deactivating the plugin
    • refreshing the permalinks
    • clearing and resetting the htaccess
    • defining the home and site url in wp-config
    • deleting the rewrite rules in the options table

    The only two pages affected are the home page and the registration page. I haven’t yet deleted any tales from the database.

    https://wordpress.org/plugins/peters-login-redirect/

Viewing 15 replies - 1 through 15 (of 30 total)
  • Have you also

    • deactivated any caching plugins?
    • flushed the rewrite rules after deleting them?
    • cleared any cookies?
    • cleared the browser cache?
    • tried in a different browser?
    • tried the default htaccess?
    • tried a fresh wp-config?

    Cheer for responding so quickly.

    There aren’t any caching plugins in use.
    I have been trying in Chrome and in Safari using Private Browsing mode.
    I’ve been refreshing the permalinks after everything I try. I think I have the default htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /newdirectory/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /newdirectory/index.php [L]
    </IfModule>
    
    # END WordPress

    I haven’t tried a fresh wp-config as the problem is on a live site and I’m afraid of making it worse than it already is. Would that ensure the database isn’t cached then?

    So this is a subdirectory install? Have you followed these instructions?

    The wp-config is just a hunch. You might compare the current one with the default wp-config-sample.php to see what’s different apart from the database info. You can also change the authentication unique keys and salts to force fresh logins without risk to the site.

    Are you refreshing the permalinks by simply going to Settings > Permalinks and clicking “Save Changes”? That should flush the rewrite rules even if you don’t make any changes.

    The Debug This plugin might be useful in inspecting the remaining rewrite rules.

    I’ll be glad to dig into the HTTP headers if you want to send me a link to the site using my profile contact.

    It is a subdirectory install.
    That’s what I’ve been doing to flush the permalinks although I tried changing them to the default as well.

    I’ll try the debug this plugin. Does it display anything on the front end?

    Thank you very much for your help 🙂

    Debug This adds a menu to the admin bar on the front-end for admins only; otherwise, it’s invisible. Go to Query > Rewrites.

    Ok I see the rewrite rules but I’m not entirely sure how to decipher them :/

    Incidentally I didn’t see anything in the rewrite rules concerning the register page

    I sent you the link via the contact form on your site.

    Can you confirm that these steps have been followed for your particular installation?

    I double checked that everything was done properly and apparently it was. There are still two copies of .htaccess one in the root directory and one in the folder. The index.php in the folder still has the original path. Not the new path.

    Could that be the issue?

    EDIT: No, that looks likes its supposed to be the case

    Yes, index.php in the root directory should have the new path.

    require( dirname( __FILE__ ) . '/newdirectory/wp-blog-header.php' );

    I will look into what the two htaccess should have.

    That it does. And in the newdirectory folder
    require( dirname( __FILE__ ) . '/wp-blog-header.php' );

    Both .htaccess files have the same thing.

    I was thinking of reinstalling 4.0 as that is when the redirect loop troubles started. I think it was when I deleted the redirect urls from the plugin although I still had it installed and activated.

    What do you think? Actually i’m ready to try about anything at this point 😉

    WordPress should modify the htaccess according to the “WordPress Address (URL)” and “Site Address (URL)” settings.

    The root directory htaccess should look like this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    and the subdirectory htaccess should look like this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /newdirectory/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /newdirectory/index.php [L]
    </IfModule>
    
    # END WordPress

    Yes, that’s what I had. I didn’t notice the Rewritebase was different in the second.

    So WordPress Address (URL) should be http://example.com/newdirectory
    and Site Address (URL) should be http://example.com
    Check those settings and Save Changes, then Permalinks and Save Changes. Remove both /newdirectory from root htaccess.

    Ok done. Still no change 🙁

    It was working fine out of the subdirectory for a long time though. Everything fell apart during the 4.0 update. Although there have been persistant redirection problems which someone attempted to correct using Peter’s login redirect.

    I’m wondering if Yoast SEO might have something to do with this? I keep coming across it in my searches for 301 errors.

    I appreciate your tenaciousness. I would have given up on me by now 😉

Viewing 15 replies - 1 through 15 (of 30 total)
  • The topic ‘Redirect loop on certain pages’ is closed to new replies.