CartMetrix - Do you know yours?

« Quick and Dirty MySQL Backup | Home | More Mod_Auth_MySQL Tips »

8/18/2006

Mod_Auth_MySQL and ErrorDocument with Apache

Mod_Auth_MySQL is a useful Apache module for allowing HTTPD Authentication against a MySQL database. This makes it very convenient to code a simple authentication process in PHP.

I beat my head against this problem for an hour before I found the solution…

When using an ErrorDocument directive in a .htaccess file similar to the form:

ErrorDocument 401 /error.php?err=401

Apache, ErrorDocument 401 and Mod_Auth_MySQL don’t seem to play nice together. Tested on several different servers, Apache kept throwing a 401 Unauthorized error back no matter how I configured it.

Turning off the ErrorDocument 401 directive for the protected directory with the following directive seems to work around the problem.

ErrorDocument 401 -

Not a perfect solution as 401’s in the protected directory will either be blank or the Apache default.

Popularity: 12%

Trackback:

Related Posts

Post your opinion

Verification Image

Please type the letters you see in the picture.

Subscribe without commenting


damonparker.org is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

copyright © 2002-2009 damonparker.org. all rights reserved.

Close
E-mail It