When you add additional http authentication to the WordPress admin dashboard or the wp-admin directory, there are chances that you get any of the following errorr when trying to access the WordPress wp-admin directory; The page isn’t redirecting properly, This web page has a redirect loop, Error 310 (net::ERR_TOO_MANY_REDIRECTS) or an HTTP 404 error as seen in the below screenshot.
This is not a WordPress problem or error, but is an issue related to the configuration of your web server or hosting provider. If you do encounter such error, you can solve the issue by adding 1 line to the WordPress root .htaccess file. Follow the below step by step procedure to solve such issue:
- Connect to your WordPress website using FTP.
- Download the .htaccess file from the root of your WordPress website.
- Add the below line before the WordPress rules (above the # BEGIN WordPress line)
ErrorDocument 401 default
That does the trick. Now your WordPress administrator dashboard is protected with double authentication.