I'm very a new comer to Apache and .htaccess, and that i were built with a simple question concerning how to handle 403 and 404 errors with Apache's ErrorDocument command.

Let us see this code from an earlier Content management systems I authored:

ErrorDocument 404 /admin/includes/access_deny.php?error=404

This can quietly redirect the consumer to http://www.mysite.com/admin/includes/access_deny.php?error=404 once they obtain a 404 error.

Here's my problem, this error document will be in the same location, according to the .htaccess file. However, if I have to move my installation, tell your directory subfolder, I will have to open the .htaccess file an update the to following, for this to operate properly:

ErrorDocument 404 /subfolder/admin/includes/access_deny.php?error=404

It is possible to way I'm able to have .htaccess redirect for this page admin/includes/access_deny.php?error=404 regarding the file itself, no absolute URL? Also, wherever I'd slowly move the installation later on, Apache will catch all 404 errors which are on a single level or sub-sites for this file.

Please tell me if that's not obvious.

Appreciate your time and effort.

In the manual:

Web addresses can start having a slash (/) for local web-pathways (in accordance with the DocumentRoot), or perhaps be a complete URL that the client can resolve. Alternatively, a note could be presented to be shown through the browser.

This thread will let you repair it though.