mod rewrite - Blocking a dynamic list of IP addresses in .htaccess? -


suppose want block bunch of ip addresses in .htaccess, make sure cannot retrieve file or url or content whatsoever.

i can put in .htaccess:

order deny,allow deny 1.2.3.4 deny 5.6.7.8 

or using rewritecond + rewriterule show custom 'blocked' message:

rewriteengine on  rewritecond %{remote_addr} 1.2.3.4 [or] rewritecond %{remote_addr} 5.6.7.8 rewriterule ^ you_are_blocked.htm 

but either way, problem can put static, hardcoded ip addresses in there. require editting .htaccess file on live website block new ip addresses, of course bad practice.

is there way have dynamic list of ips, can used in .htaccess? example, possible have file "blocked-ip-addresses.txt" somewhere, , include in .htaccess? way can dynamically write or update blocked ip list, or make user interface around this, example in admin section of website.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -