WordPress.org

Support

Support » Multisite » [Resolved] TOO_MANY_REDIRECTS Error when using basic authentication

[Resolved] TOO_MANY_REDIRECTS Error when using basic authentication

  • I set up multisite and add the following on .htaccess to use basic authentication on log-in page (wp-login.php) and getting error “310 (net::ERR_TOO_MANY_REDIRECTS)” and I can not access to the log-in page.

    It works on the local set up using XAMPP but not work on the server.

    What am I doing wrong?

    <files wp-login.php>
    AuthName "Login Password Required"
    AuthType Basic
    AuthUserFile /home/xxxx/.htpasswd
    require valid-user
    </files>
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    Multisite setup on the server and local (XAMPP)
    (using sub-directory and installed on the subdomain)
    test.xxxx.com (root site)
    test.xxxx.com/en/
    text.xxxx.com/jp/

    I would appreciate it if anyone could suggest about this issue.

    Thank you.

Viewing 11 replies - 1 through 11 (of 11 total)
  • which version of xammp r u using?

    esmi

    @esmi

    Forum Moderator

    Have you spoken to your hosts about this?

    Thank you, ak75963.
    xammp version is 1.8.1

    Thank you, esmi.
    Yes, but their response is as follow;
    Sorry about the issues you’re having with your website. Unfortunately providing support for .htaccess modifications is outside the type of support we offer. You would have to consult with a developer about any coding issues.

    esmi

    @esmi

    Forum Moderator

    Personally, with a response like that, I’d be looking at moving hosts! What happens if you just use:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . index.php [L]

    Thank you esmi.

    If I just use above code, I get the same error (TOO_MANY_REDIRECTS).

    If I use below code, the authentication box pop ups but after put the user name and password, I get the same error.

    <files wp-login.php>
    AuthName "Login Password Required"
    AuthType Basic
    AuthUserFile /home/xxxx/.htpasswd
    require valid-user
    </files>
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . index.php [L]

    When I use the same basic authentication on the single site it works fine on the same server.

    esmi

    @esmi

    Forum Moderator

    I’m by no means a multiuser expert but I suspect that you will have problems trying to password protect wp-login.php in this way across a network. But I could be wrong…

    Did you send a copy of the original .htaccess file to your hosts when asking them about this issue? Seems to me that this is a server configuration issue so they should have had something to say about it.

    Thank you esmi!

    I will contact my hosts again.
    Thank you for your advise!
    I appreciate it.

    I’m by no means a multiuser expert but I suspect that you will have problems trying to password protect wp-login.php in this way across a network. But I could be wrong…

    Multisite 😉

    This should work on Multisite, to be honest, I’ve never bothered with it. Take it out to veryify that WP is working without it, though. It may not be the htpasswd.

    Thank you Ipstenu.

    WP is working without it, I have created the subdirecoty on the same server and installed the backup and found out it works fine (I can log-in with basic authentication on xxxx.com/test/wp-login.php).

    I’m wondering if this is related with hosting’s subdomain configurations and I submitted the ticket to my hosts.

    I got the solution from hosts and that is just add the following two lines to .htaccess.

    ErrorDocument 401 "Denied"
    ErrorDocument 403 "Denied"

    Thank you.

    I close this.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Resolved] TOO_MANY_REDIRECTS Error when using basic authentication’ is closed to new replies.
Skip to toolbar