Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this in my .htaccess file:

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

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

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

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

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

Your Answer


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