PHP 404 Error Redirect Not Working

So while editing my .HTACCESS file I added the proper lines to redirect users that encounter errors like 404 and 500. It works like a charm if I tell it to display a specific message. However if I tell the file to redirect users to a custom error page it fails.
When testing out my 404 redirect I get this:
Not Found
The requested URL /143/test.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.
Apache/2.4.9 (Win64) PHP/5.5.12 Server at localhost Port 80
As you can see it is stating that my ErrorDocument is not found BUT if I type my ErrorDocument URL in I can go to it myself.
My .HTACCESS file looks like this:
ErrorDocument 400 /error.php
ErrorDocument 401 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php
ErrorDocument 500 /error.php
ErrorDocument 502 /error.php
ErrorDocument 504 /error.php

supress php errors

php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off

enable PHP error logging

php_flag log_errors on
php_value error_log PHP_errors.log
NOTE: I am using localhost (WAMP).
Thanks.

Judging from your htaccess file, you have most possible errors going to error.php. I take it this isn’t what you want?

Sponsor our Newsletter | Privacy Policy | Terms of Service