.htaccess not getting 404 php pages?

F

Florent

Hi,

this is a section of my .htaccess file.

================================================
ErrorDocument 404 /errors/errors.php?e=404
ErrorDocument 500 /errors/errors.php?e=500

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

================================================

But it is not picking up unknown php pages, what could be the problem?

Regards,
 
D

Dave Patton

this is a section of my .htaccess file.

================================================
ErrorDocument 404 /errors/errors.php?e=404
ErrorDocument 500 /errors/errors.php?e=500

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

================================================

But it is not picking up unknown php pages, what could be the problem?

A)
Look at your Apache error log - you may find
that you are getting both a 404 error as well
as another error when Apache tries to use your
ErrorDocument 404 directive, and that may give
you some clues.

B)
Get rid of the query string:
ErrorDocument 404 /errors/errors.php
ErrorDocument 500 /errors/errors.php
In errors.php use the $REDIRECT... variables:
http://httpd.apache.org/docs/custom-error.html
For example:
switch( $REDIRECT_STATUS )
{
case "404": // Not Found
print("<p>The reqested resource, <b>$REDIRECT_URL</b>, ");
print("does not exist on our website.</p>");
break;
case "403": // Forbidden
case "401": // Unauthorized
print("<p>You are not authorized to access
<b>\"$REDIRECT_URL\"</b></p>");
break;
default:
print("<p>An error has occurred during a \"$REDIRECT_REQUEST_METHOD\"
request - ");
print("The HTTP response code is $REDIRECT_STATUS</p>");
break;
}

C)
This isn't an HTML or PHP question, so you may
get better help in a newsgroup that deals with
Apache configuration issues.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,829
Messages
2,569,737
Members
45,521
Latest member
maryb

Latest Threads

Top