We need to have an IP protected Apache. So only a couple of IPs allowed for the whole server. Rest needs to be blocked. However, since all other IPs are blocked, even the custom error documents are blocked?! I've even chmoded these files to 777. My Directory code is below. Welcome any thoughts on how at least the
404.htm can be "allowed" for everyone so they can show up. Thanks.
<VirtualHost *:80> DocumentRoot /opt/public ServerName xyz.com <Directory /opt/public> AllowOverride ALL Require all granted Options -Indexes Order Deny,Allow Deny from All Allow from 126.96.36.199/16 Allow from 188.8.131.52/16 ErrorDocument 403 /opt/public/400.htm ErrorDocument 404 /opt/public/404.htm <Files 400.htm> <RequireAll> Require all granted Require not env blockAccess </RequireAll> </Files> <Files ~ "404\.htm$"> <RequireAll> Require all granted Require not env blockAccess </RequireAll> </Files> </Directory> </VirtualHost>