Forum Moderators: phranque
>Yes I put in something like ErrorDocument 401 /401.html and also tried it with the full url, but the custom error page still didn't appear.
Just to verify, did you use ErrorDocument 401 /401.html, or ErrorDocument 401/sub/401.html?
BTW, don't ever use a full URL in an ErrorDocument directive; If you do, Apache will do an external redirect, and the status returned to the client will be 302-Found, and not the expected 401, 404, 500, etc. This behaviour is described in the Apache ErrorDocument documentation.
Jim
I think you may find that authentication is performed before any other function in .htaccess (for practical as well as security reasons). Therefore, you may have to split the code across multipe subdirectory levels, or do it in http.conf. Hopefully, some who's done this will have some advice based on experience...
Jim