WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] wp-admin redirects & p/w locking causes redirect loop (7 posts)

  1. David
    Member
    Posted 7 months ago #

    For days I've been trying to fix this issue. Tweaking this and that with help from my host. Today I escalated my methodology and decided to do a clean install of the core files:

    1) downloaded the latest zip from wordpress.org

    2) deleted all the directories and files within public_html except for: wp-content and wp-config.php

    3) SFTP to public_html and transferred all the clean WordPress files to the server.

    4) Tested the site which is working fine

    5) Tested the wp-admin and it still redirects to http://www.mysite.com/wp-login.php?redirect_to=http%3A%2F%2Fwww.mysite.com%2Fwp-admin%2Findex.php&reauth=1

    6) Setup BulletProof Security settings again in the WordPress admin dashboard.

    7) Tested site and it's working fine

    8) Password locked the wp-admin directory via cpanel > password protect directories

    9) Tested wp-admin and get a "This page has a redirect loop" warning

    10) Cleared browser cache

    11) tested wp-admin and get a "This page has a redirect loop" warning

    12) turned off wp-admin password lock via cpanel > password protect directories

    13) tested wp-admin and it goes to http://www.mysite.com/wp-admin/ (again note no trailing php file as I would expect it should)

  2. David
    Member
    Posted 7 months ago #

    and additionally

    14) renamed plugins folder

    15) password protected wp-admin directory

    16) test wp-admin and get "This page has a redirect loop" warning

    17) removed password protection from wp-admin directory

    18) tested wp-admin which redirects to http://www.mysite.com/wp-login.php?redirect_to=http%3A%2F%2Fwww.mysite.com%2Fwp-admin%2Findex.php&reauth=1

    19) login and it again takes me to /wp-admin/ without any trailing index.php for example

    I mean it works as such but that redirect? Should it be happening? Should the page immediately after logging in actually be the index.php?

  3. Oizuled
    Member
    Posted 7 months ago #

    Can you manually edit the main WordPress .htaccess file?

    If so, add the following line to the top (or before the WordPress rules start if you have other things in there).

    ErrorDocument 401 default

    This should help solve the issue.

  4. David
    Member
    Posted 7 months ago #

    This is for the one in the WordPress directory, correct? Or the wp-admin directory?

    I have just tried in both anyway and it didn't seem to change anything.

    Been attempting to work my way through the Hardening WordPress guide and it's increasingly making more sense to me as I work through it. This password protect of the admin folder seems the breaking point though.

    Without the lock navigating to /wp-admin SHOULD behave how? I've been messing with this for so long I forget :S That redirect shouldn't be there or is that in fact how it should be?

    I see it as though it's in error (at step 5) before I do anything else - hence why the password protection throws it into a hissy fit.

    Or not.. just wrapping my head around it.

  5. Oizuled
    Member
    Posted 7 months ago #

    Take a read through this post, which may help you figure out where the issue is.

    I said that the .htaccess 401 line should work, however each host has a different set of rules and it doesn't work 100% of the time.

  6. David
    Member
    Posted 7 months ago #

    CORRECTION

    It looks like the behaviour is normal again. Maybe my browser had a cached version for a bit. Thanks for the link and your help.

    I think in the process I had to go way too complex for my liking and it's great to have closure with a nice simple bit of code. Haha.

  7. The Max tech finder
    Member
    Posted 2 months ago #

    Hi there, just squabbling time with my site!!!
    the same error, i can't even log into my wp-admin.

    have decided to change the host and just clean my data launching afresh the full .... like starting from scratch. in the meantime i don't want to loose my rank, my style and clients....

    What can cause that error? and what's the easy way to solve it?

Topic Closed

This topic has been closed to new replies.

About this Topic