I’m not sure if this is specific to my site or not, but if anyone knows how to override this behavior, that would be most appreciated! I have WordPress installed in the root directory of my server. There is also an unrelated sub-directory we’ll call ‘restricted-dir’. I have added an .htaccess file inside that directory with the following code:
Deny from all
Without that command, if a user visits www.my-domain.com/restricted-dir/ it would list all contents. I would like the user to receive the server’s typical 403 Forbidden message, but instead WordPress kicks in and directs the user to my 404 page on my website.
Is there anything I can do to make the 403 page show up instead of the 404 page along with my entire WordPress install?