Title: TOO_MANY_REDIRECTS Error  when using basic authentication
Last modified: August 21, 2016

---

# TOO_MANY_REDIRECTS Error when using basic authentication

 *  Resolved [tk5](https://wordpress.org/support/users/tk5/)
 * (@tk5)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/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)

 *  [ak75963](https://wordpress.org/support/users/ak75963/)
 * (@ak75963)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/too_many_redirects-error-when-using-basic-authentication/#post-3874307)
 * which version of xammp r u using?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/too_many_redirects-error-when-using-basic-authentication/#post-3874424)
 * Have you spoken to your hosts about this?
 *  Thread Starter [tk5](https://wordpress.org/support/users/tk5/)
 * (@tk5)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/too_many_redirects-error-when-using-basic-authentication/#post-3874427)
 * 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](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/too_many_redirects-error-when-using-basic-authentication/#post-3874442)
 * 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]
       ```
   
 *  Thread Starter [tk5](https://wordpress.org/support/users/tk5/)
 * (@tk5)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/too_many_redirects-error-when-using-basic-authentication/#post-3874446)
 * 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](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/too_many_redirects-error-when-using-basic-authentication/#post-3874447)
 * 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.
 *  Thread Starter [tk5](https://wordpress.org/support/users/tk5/)
 * (@tk5)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/too_many_redirects-error-when-using-basic-authentication/#post-3874448)
 * Thank you esmi!
 * I will contact my hosts again.
    Thank you for your advise! I appreciate it.
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [12 years, 9 months ago](https://wordpress.org/support/topic/too_many_redirects-error-when-using-basic-authentication/#post-3874455)
 * > 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…
 * Multi_site_ 😉
 * 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.
 *  Thread Starter [tk5](https://wordpress.org/support/users/tk5/)
 * (@tk5)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/too_many_redirects-error-when-using-basic-authentication/#post-3874494)
 * 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.
 *  Thread Starter [tk5](https://wordpress.org/support/users/tk5/)
 * (@tk5)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/too_many_redirects-error-when-using-basic-authentication/#post-3874503)
 * 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.
 *  Thread Starter [tk5](https://wordpress.org/support/users/tk5/)
 * (@tk5)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/too_many_redirects-error-when-using-basic-authentication/#post-3874556)
 * I close this.

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

The topic ‘TOO_MANY_REDIRECTS Error when using basic authentication’ is closed to
new replies.

## Tags

 * [authentication](https://wordpress.org/support/topic-tag/authentication/)
 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 11 replies
 * 4 participants
 * Last reply from: [tk5](https://wordpress.org/support/users/tk5/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/too_many_redirects-error-when-using-basic-authentication/#post-3874556)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
