Protecting .user.ini file using .htaccess rule
-
Hi @nintechnet,
Good morning!May I ask what would be a recommended way to secure the access to the “.user.ini” type files, as below, using .htaccess?
And, should such rule exist for each of the .user.ini files according to their specific name?.user.ini type files:
1) .user.ini.ninja1618237526
2) .user.iniSuch way may include excluding rules for fixed IPs used.
Possibly it would look of the kind:
# Wordfence WAF <Files ".user.ini"> <IfModule mod_authz_core.c> Require all denied RewriteCond %{REMOTE_ADDR} !^63\.33\.119\.0$ RewriteCond %{REMOTE_ADDR} !^52\.213\.31\.160$ RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$ RewriteCond %{REMOTE_ADDR} !^fixed_ip1 RewriteCond %{REMOTE_ADDR} !^ fixed_ip2 RewriteCond %{REMOTE_ADDR} !^ fixed_ip3 RewriteCond %{REMOTE_ADDR} !^ fixed_ip4 </IfModule> <IfModule !mod_authz_core.c> Order deny,allow Deny from all RewriteCond %{REMOTE_ADDR} !^63\.33\.119\.0$ RewriteCond %{REMOTE_ADDR} !^52\.213\.31\.160$ RewriteCond %{REMOTE_ADDR} !^fixed_ip1 RewriteCond %{REMOTE_ADDR} !^ fixed_ip2 RewriteCond %{REMOTE_ADDR} !^ fixed_ip3 RewriteCond %{REMOTE_ADDR} !^ fixed_ip4 </IfModule> Allow from 63.33.119.0 Allow from 52.213.31.160 Allow from fixed_ip1 Allow from fixed_ip2 Allow from fixed_ip3 Allow from fixed_ip4 </Files>
Where fixed_ip1, fixed_ip2… are fixed IPs used by the site owner to access its server instance?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Protecting .user.ini file using .htaccess rule’ is closed to new replies.