Whitelisting Multiple IPs in ModSecurity
If ModSecurity is blocking legitimate requests from specific IP addresses, you can whitelist those IPs so their traffic bypasses the web application firewall rules.
Method: .htaccess
Add the following to your .htaccess file to disable ModSecurity for specific IPs:
<IfModule mod_security2.c>
SecRule REMOTE_ADDR "@ipMatch 1.2.3.4,5.6.7.8,9.10.11.12" "id:1000001,phase:1,allow,nolog"
</IfModule>
Replace the IP addresses with the ones you want to whitelist. Separate multiple IPs with commas.
Server-Level (Root Access Required)
For server-wide whitelisting, add the rule to /etc/apache2/conf.d/modsec/modsec2.user.conf and restart Apache. This is a server administrator task. If you are on shared hosting, contact support and provide the IP addresses you need whitelisted along with the URL that is being blocked.
