Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have this in my .htaccess file:

    <FilesMatch "(contracts|concepts)$">
    AuthName "Contracts"
    AuthType Basic
    AuthUserFile /is/htdocs/wp54963193_ZBG2Q9J2R8/www/.htpasswd
    Require valid-user
</FilesMatch>

This is fairly basic and works fine for me. However, when a user enters a wrong password he is being taken to a 401 error page. The same if he refuses to enter a password and simply clicks "Cancel". Clearly this is not very user-friendly at all.

Is there any way to specify a forwarding or error page or something?

Thanks for any help in this matter.

share|improve this question
add comment

migrated from stackoverflow.com Oct 3 '11 at 13:07

This question came from our site for professional and enthusiast programmers.

1 Answer

I guess you should be able to set a custom page for 401 error, just as for other pages:

ErrorDocument 401 /error.php
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.