How to record invalid entries (php.htaccess)

I created .htaccess files that will not allow anyone to access the file if they don’t have a username and password, how can I register files when someone tries to access the wrong information and then denies the IP address.

I know this in php, but .htaccess, I'm still new to it.

Thanks to everyone.

+3
source share
1 answer

You can use ErrorDocument 401 /log_request.phpto send all these requests to some PHP script.

Take a look at this tutorial for more information: http://www.askapache.com/htaccess/htaccess-htpasswd-basic-auth.html

: , http://www.fail2ban.org/

+2

Source: https://habr.com/ru/post/1741608/


All Articles