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