Sorry for the delayed answer. Yesterday we had a power outage followed by an Internet outage. Service was restored last night, only for the power to go out, again, this morning. FINALLY I have both power and Internet.
I tried to reproduce your issue. I am using the .htaccess Maker like you do. I created a file named 403-error.htm (note that the extension .htm, NOT .html, .Htm, .Html, .HTM or .HTML – these are all different extensions and yes, case does matter).
In the .htaccess Maker I added the following to "Custom .htaccess rules at the top of the file":
ErrorDocument 403 /403-error.htm
I also added the following in a new line in the "Allow direct access to these files" area:
403-error.htm
Please note that the name, including the lowercase/uppercase letters of the filename and extension, match exactly the file on my site's root.
Trying to raise any kind of 403 error it works. I see the contents of my file instead of the default 403 error page. To make sure I am not mistaken I had my custom error page display "Baby did a bad, bad thing" (yes, that's Chris Isaak lyrics).
However, there is exactly one case where this doesn't work by itself (and I did test that it doesn't): when you are blocking access to an IP (e.g.with something like "deny from 111.222.333.444") AND you are trying to access a .php file. "Acces a .php files" also applies when you are trying to access a SEF URL on your site such as /foo/bar.html or index.php/foo/bar.html since this is a missing file which is redirected internally by Apache to your site's index.php (that's how SEF URLs work). Because of the way Apache works under the hood you do need to add the following to the "Custom .htaccess rules at the bottom of the file":
<Files "403-error.htm">
Allow from all
</Files>
So, if you did follow my earlier advice to fix your code AND add the 403-error.html file to the "Allow direct access to these files" area your issue can no longer be reproduced. I can only assume that you missed one of the steps?
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!