Forum Moderators: phranque
I have a .htaccess file in the root directory for custom pages. I then have various folders (client1, client2 etc) each with their own .htaccess files to password protect those directories.
The trouble is if I have a custom Error 401 page then when you go to one of the protected folders it immediately goes to the Error 401 page without asking for a logon and password. As soon as i take the Error 401 reference out, the password protection works perfectly.
My host company use Zeus.
Apologies if this something obvious but I am new to web stuff.
Thanks
ErrorDocument 404 ../404.html
ErrorDocument 401 ../401.html
The second from the htaccess in the protected folders:
AuthUserFile /content/StartupHost/c/a/wwWebmasterWorldebsite.co.uk/.htpasswd
AuthGroupFile /dev/null
AuthName "Please enter your user name and password:"
AuthType Basic
require user mylogon
Thanks
Replace the ../404.html with /404.html or if it is not in the document root, then change it according to the location of the file, like /somedir/404.html According to the apache documentation the resource you sepecify for the ErrorDocument must be interpretable by the client, so if you use ../something in your root htaccess file this is not true anymore. See [httpd.apache.org...]
Don't use the AuthGroupFile if you don't need it. If you alow only some users to be allowed to access to the resource (Require user someuser), then it will not get messed up by any other groups defined earlier, so no use to keep it there.