Usage of htaccess to handle 403 errors

In one of my subdomains, I was forced to block access to an existing folder, which I did, setting the access permissions to 640. That caused the server to return a 403 error for the folder concerned.

I would like to capture the error, thus I uploaded a .htaccess file into the subdomain’s main folder. The .htaccess file contained the following lines:

ErrorDocument 403 /noaccess.html
ErrorDocument 404 /noaccess.html

However, upon testing the file by accessing the blocked folder, the server kept returning the error:

You don’t have permission to access /1gallery on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

The file noaccess.html exists on the server, and the 404 redirection serves the file correctly. How do I get the server to start sending out noaccess.html for 403 errors?

Thanks in advance for your help!

Visit my blog