Welcome, Guest. [ Log In ]
Question   Custom 401 (Failed Authorization) error pages.
Search KBase


Related Links:
· Custom 404 (File Not Found) error pages.
· Custom 403 (Forbidden) error pages.
· Custom 500 (Internal Server Error) error pages.

Top 4 in this Area:
1. Custom 404 (File Not Found) error pages.
2. Custom 403 (Forbidden) error pages.
3. Custom 401 (Failed Authorization) error pages.
4. Custom 500 (Internal Server Error) error pages.

 
Custom 401 (Failed Authorization) error pages.
Please follow the instructions for making a Custom 404 error page but instead of naming the custom file missing.html, name the custom file failed_auth.html (and put it in your web directory.. not the root of your home directory).

This page will show up when somebody doesn't successfully enter their password to get into a password-protected area of your web site.

Last updated: Sep 08, 2003.

Official Reply (2002-09-12 20:16:46 )
Yup, the failed_auth.html file is used when people hit 'Cancel' just like if they enter an invalid username and password!
User Post (2005-11-08 17:08:47 by wschuller)
I think the problem I have is that I want all of our site to be htpasswd protected from the root down.

The problem is this makes the failed_auth.html protected also!

How do we get around this? Do we have to set the failed_auth.html to be a special exception in the .htaccess file? How do I do this?
User Post (2005-04-14 13:37:11 by marksohmer)
To the person who said:

"Might be nice if the custom 401 file could end in, say, .php or .shtml. That way we could include a little scripting in the file to generate custom messages based upon the requested URL. Forcing the 401 error file to end in .html is a bit limiting -- besides being unnecessary."

You can do this!

vi .htaccess (or edit it however you'd like) and add at the top:

ErrorDocument 401 /failed_auth.php

User Post (2004-04-14 05:21:13 by raena)
Maylett - you should have no trouble doing this by adding it to your htaccess file. If you don't already have one, make one, and add this line:

ErrorDocument 401 /yourcustomfailedauthpage.php

The slash in front means that it's on the root of your domain - edit if necessary.
User Post (2003-12-06 07:23:38 by arbors)
How does one limit the number of times a ID/PW prompt is given, when a user makes errors or just doesn't have the codes?
On my secure page the prompt is given 5 times before going to the failed_auth.html file, causing users to conclude they are caught in a "loop"...
User Post (2003-10-17 20:07:02 by maylett)
Might be nice if the custom 401 file could end in, say, .php or .shtml. That way we could include a little scripting in the file to generate custom messages based upon the requested URL. Forcing the 401 error file to end in .html is a bit limiting -- besides being unnecessary.
User Post (2003-10-13 13:10:11 by miltimj)
diva, I think jkennard wants two different types of behavior -- if the user hits cancel, a meta refresh should be used, if the user's authentication fails, it should go to failed_auth.html and display a helpful message. This can't be done by using your suggestion.
User Post (2003-05-23 10:50:24 by diva)
For the person who asked whether it was possible to redirect them back to the original site: Sure, just create a failed_auth.html that has a meta refresh tag pointing back to the main site.
User Post (2003-01-03 03:32:11 by tripster045)
How do I create a custom 401 page? I created the page and saved it as "failed_auth.html" and uploaded to my root dir but when I press the cancel button the default 401 page displays.

What am I doing wrong?
User Post (2002-12-30 14:49:11 by jmetter)
I'd like to know how to do that as well.
User Post (2002-09-12 06:36:29 by jkennard)
Is there a "Custom" page that can be set up if someone hits 'Cancel' instead of trying to log-in? Can they be redirected back to the original site instead of getting sent to the "Failed Authorization" page?