I am trying to set up an 403 error document in Apache, using a PHP file, like this (via .htaccess):
order deny,allow
deny from all
allow from [MY_IP]
ErrorDocument 403 /err403.php
but it doesn't works, it shows the apache default 403 error, but if I use a .html errordocument it works, like this:
order deny,allow
deny from all
allow from [MY_IP]
ErrorDocument 403 /err403.html
Then it shows the customized HTML document with the error page. I am using SuPHP. And the apache and php in Ubuntu 14.04 Server repositories.
If I remove this restriction from the .htaccess, the file err403.php could be read normally.
Any ideas?? Thanks!!
edit: ie., changing the allow from ip to another ip so that it triggers the error.