PHP as ErrorDocuments (Apache)
| From: | o dot cook at etoncollege dot org dot uk | Date: | Tue, 05 Sep 2000 23:26:30 +0000 |
| Subject: | PHP as ErrorDocuments (Apache) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-15402@lists.php.net to get a copy of this message | ||
I'm having a little trouble with using PHP scripts as ErrorDocuments, but
I'm not sure where I'm slipping up.
For example - I have the following in my .htaccess file:
<Files "config.inc.php">
order deny,allow
deny from all
</Files>
<Files "diary_admin.php">
AuthUserFile /home/ollie/htpasswd
AuthGroupFile /dev/null
AuthName "Diary Admin"
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>
</Files>
ErrorDocument 401 /forbidden.php
ErrorDocument 404 /missing.php
If I go to http://site.com/non-existant then I get
missing.php - which
parses correctly - great!
However, if I go to http://site.com/diary_admin.php I
get forbidden.php,
parsed correctly, before I'm even prompted for a username and password.
Sometimes, however, it works. I tried clearing the cache etc. but that
didn't seem to help.
Can anyone see an obvious mistake that I'm making? For information: Server
Version: Apache/1.3.12 (Unix) PHP/4.0.0
Ollie
P.S. I'm aware that 401 is actually "Authorization Required" and that 403 is
"Forbidden", but am just to lazy to rename the file! :)
--------------------------------------------
Ollie Cook +44 (7946) 057 198
PGP: http://ollie.zenox.dhs.org/pgp-key
--------------------------------------------