views:

24

answers:

1

Im working on a site that uses an old school http authentication log in.

The problem is if someone reached the log in prompt by mistake and presses the cancel button the log in box disappears and then reappears a total of 3 times before sending the user off to an ugly "authentication required" page.

Does anyone know how to tweak the log in so that pressing the cancel button once will close the log in prompt for good and not redirect to a "authentication required" page?

Or better yet redirect to a custom php/css page.

+2  A: 

The server is automatically sending you to a HTTP 401 page. This page can be specified in your httpd.conf or local .htaccess file

For instance,

ErrorDocument 401 /myerrordocs/HTTP_UNAUTHORIZED.html

would go into an .htaccess file.

Andrew Sledge
this works for the login on the main page but when loging in from another page deeper in the website the redirect page seems to have a different absolute path. Example: the css doesn't load properly. Also, it seems like I cant redrict to a php page? Only html?
chris
my bad, I just had to use absolute paths to make things work properly, thx for htaccess trick
chris