I learn how to prohibit an Insolvency practitioners address from the apache webserver using .htaccess:

order allow,deny
deny from 192.168.44.201
deny from 224.39.163.12
deny from 172.16.7.92
allow from all

Let me produce a custom "You have been banned" page. How could I actually do this?

EDIT:

To explain, I'm not trying to produce a custom 403 page, because these are utilized in other instances too (i.e. unsuccessful fundamental authentication, etc). The nearest I've come to date is:

rewritecond %{REMOTE_ADDR} ^127\.0\.0\.1$
RewriteRule !^banned$ /banned [NC,L]

but this produces an interior server error once the IP is matched up, rather than delivering the consumer to /banned

Another solutions which suggest an ErrorDocument for that 403 code will be the usual method of doing this. Consider you need to show another error page when the user is refused access according to IP (instead of some other reasons), you should use mod_rewrite, while you suspected.

RewriteCond %{REMOTE_ADDR} =192.168.44.201 [OR]
RewriteCond %{REMOTE_ADDR} =224.39.163.12 [OR]
RewriteCond %{REMOTE_ADDR} =172.16.7.92
RewriteRule !^/banned.html /banned.html [L]

P.S. This will use your virtual host configuration, no .htaccess file, if whatsoever possible. Without having accessibility virtual host configuration file, you can place it inside a .htaccess file, but take away the leading slash in the RewriteRule pattern (so !^/banned.html becomes !^banned.html).

You utilize an ErrorDocument directive. People who are refused access are sent a 403 header, so:

ErrorDocument 403 banned.html

will redirect banned individuals to banned.html


Edit: Another alternative would be to drop the mod_access stuff altogether, and employ an IP-based rewrite rule (as pointed out within the question). It will you need to be:

RewriteEngine on
RewriteCond %{REMOTE_ADDR} 192.168.44.201 [OR]
RewriteCond %{REMOTE_ADDR} 224.39.163.12 [OR]
RewriteCond %{REMOTE_ADDR} 172.16.7.92
RewrulteRule .* banned.html [L]


Edit 2: David beat me for an almost identical answer I believe his way is what you would like

Inside your .htaccess file:

ErrorDocument 403 /banned.html 

change /banned.html to whatever path/to/filename you would like.