So I have a Password Protected Localhost Server to prevent these unknown IPs from getting in my server.
What I want to do is as soon as they try logging in and they get a 401 error htaccess sends them to a file called block.php
as so: ErrorDocument 401 /block.php
The problem is though, because they are not authorized to view anything on that site, block.php does not get called at all.
How do I work around this?
My httaccess looks like this:
AuthType Basic
AuthName "C:\\xampp\\htdocs"
AuthUserFile C:\\xampp\\htdocs/.htpasswd
Require valid-user
<FilesMatch block.php>
Order Deny,Allow
</FilesMatch>
ErrorDocument 401 /block.php
ErrorDocument 400 /block.php
ErrorDocument 403 /block.php
############### START BANS ###############