.htaccess Files / PHP4 and ErrorDocuments

.htaccess Files / PHP4 and ErrorDocuments

Post by Joe Jenkin » Sat, 29 Apr 2000 04:00:00

    I just upgraded my webserver to apache 1.3.12 and to PHP4 RC1.

Previously, I was using Apache 1.3.9 and PHP 3, and I had this is the
httpd.conf to return my own custom error pages on auth / access errors.  It
worked great, as did all my .htaccess files.

ErrorDocument 401 /401.php3
ErrorDocument 403 /403.php3

Now, if I enable ErrorDocuments 401 and 403 in either the .htaccess file or
in the httpd.conf file and try to open a directory on my sserver that is
protected by .htaccess, it just displays the 403 error page and never gives
me the login.  I have messed with alot of my apache settings looking for a
reason for this.  I have been using apache for a few years but have never
seen this behavior.  If I disable ErrorDocument 401 and 403 then my
.htaccess logins start working again.

Any ideas?  Thanks All!!

Joe Jenkins
System Administrator
NoWalls, Inc. / Nerdnet.com


1. RHL7.0 and PHP4: Apache config file problem: file extensions

The /etc/httpd/conf/httpd.conf file that comes with RHL7.0 contains the
following lines (see below). This is pointless as Red Hat 7.0 does not
install PHP/FI which is now outdated and does not install PHP3 either
but does install PHP4 which is broken up into the packages php-ldap,
mod_php, php, php-imap, php-mysql, php-pgsql, and php-manual. Hence
the PHP/FI and perhaps also the PHP3 lines should have been commented
out by the RPM spec file as I can now use .php3 extensions but not
.php or .php4 extensions for files to be correctly interpreted by the
Apache web server and I am not root on the system hence I cannot change
this. Has this problem been fixed in Red Hat 7.1?


# The following is for PHP4 (conficts with PHP/FI, below):
<IfModule mod_php4.c>
  AddType application/x-httpd-php .php4 .php3 .phtml .php
  AddType application/x-httpd-php-source .phps

# The following is for PHP3:
<IfModule mod_php3.c>
  AddType application/x-httpd-php3 .php3
  AddType application/x-httpd-php3-source .phps

# The following is for PHP/FI (PHP2):
<IfModule mod_php.c>
  AddType application/x-httpd-php .phtml

2. Kernel Setup

3. Apache / PHP4 not serving .php files

4. Kformula

5. PHP4 instructions do not work in HTML files

6. Diamond Stealth 64 in X Windows @ 70Hz ??

7. ErrorDocument & .htaccess

8. Fear about a WLAN card

9. .htaccess examples ErrorDocument 404

10. htaccess and ErrorDocument

11. ErrorDocument in .htaccess

12. ErrorDocuments / HTACCESS probs

13. Apache 1.2.6 .htaccess/errordocument redirect problem