Forum Moderators: phranque

Message Too Old, No Replies

.htaccess file

         

dipsy developer

9:59 pm on Jan 21, 2009 (gmt 0)

10+ Year Member



Hi, im relatively new to php and am trying to create an error handling script. I understand that the .htaccess page is the best place to handle and direct error but cannot get it to work :(

I have tried this in the .htaccess file and it works fine..
ErrorDocument 404 "<html><head><title>NO!</title></head><body><h2><tt>There is nothing here.. go away quickly!</tt></h2></body></html>

when i try the following ..
ErrorDocument 404 /errors/errorhandler.php

it doesnt go to the php page but instead displays the standard 404 error...
"Not Found
The requested URL /lrntest/mandip/mattcode/index444.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

Does anyone have any idea why this might be?
Any help would be much appreciated, Thanks.

encyclo

2:37 am on Jan 23, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld dipsy developer :)

Assuming that the path to the ErrorDocument is correct, have you tried moving the errorhandler.php to a different location? Do you have an Alias defined for the /errors/ directory? That might explain why Apache can't find the file.