auth basic no prompt, causing infinite loading of pages

par_sebastien

Member
Sep 15, 2017
6
3
3
Canada
cPanel Access Level
Root Administrator
Hi,

I've tried setting up authentication to limit attacks to wp-login.php for WordPress sites.

When I do, there is no prompt and the pages/directories keep loading infinitely.

These are the directives I put in /home/.htaccess:

Code:
ErrorDocument 401 "Unauthorized Access"
ErrorDocument 403 "Forbidden"

<FilesMatch "^(wp-login|xmlrpc)\.php$">
AuthName "Restricted"
AuthType Basic
AuthBasicProvider file
AuthUserFile /home/.htpasswd
require valid-user
</FilesMatch>
I've also tried using the Directory Privacy tool with the same result.
 

nixuser

Well-Known Member
May 30, 2014
149
37
28
nixuser.com
cPanel Access Level
Root Administrator
Twitter
Hmmm.... This did work. Maybe some rewrite rule was overriding the authentication process somehow?
The problem is that accessing protected content makes Apache send a 401 header. I encountered this problem in a software install a while back and turning off mod_rewrite after the errordocument lines did the trick for me. More details can be found if you search wordpress forums.
 
  • Like
Reactions: cPanelLauren

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
6,814
541
263
Houston
cPanel Access Level
DataCenter Provider
  • Like
Reactions: nixuser