.htaccess - php logging of 403 errors -


In htaccess I have set ErrorDocument 403 on some custom php page, such as:

  Error document 403 http://www.site.com/error/403-forbidden.php  

It's a matter of fact, I want to find an easy way to keep track of everyone on the site 403 is to be prohibited. So far, I have a PHP code to send me an email with my IP, etc. But what I am not getting is anything that will tell me how that person ended up there.

For example, I have a rule that refuses to use the dollar sign ($) in the dollar of the dollar. So, if I go deliberately: $ 403-refuses. The FTP script gets redirected. In this script, "There is no way for this person to get there because they tried to use $" (or something like that)?

On your 403-forbidden .fp page, you can use $ _SERVER ['HTTP_REFERER'] variable To check that the user tried to visit the URL before ending on your error page.

You can log it into your database, or send it to your mail address.


Comments