0

I am having a strange issue where if the <FilesMatch> is set the basic auth does NOT work. If I comment out the <FilesMatch>, the basic authentication works.

I replaced the ips for now with 1.1.1.1

#htaccess authentication
AuthType Basic
AuthName "Preview Site"
AuthUserFile /var/www/mywebsite.com/.htpasswd
Require valid-user


<FilesMatch ".*">
    Require ip 1.1.1.1/23
    Require ip 1.1.1.1/22
</FilesMatch>

#BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Victor
  • 63
  • 5
  • You have error, or the Basic Auth are not prompt ? And why make a restriction in .* files ? – Inazo Jun 08 '20 at 15:39
  • 1
    @Inazo Found it. It was something to do with the Require ip. Used the old method from Apache 2.2 – Victor Jun 08 '20 at 15:49

0 Answers0