Rectangle 27 0

apache PHP header 404 .htaccess ErrorDocument not working on local machine (MAMP)?


404.php
ErrorDocument 404 /404.php
ErrorDocument 404 /Users/me/folder/mamp/404.php
ErrorDocument 404 http://domain.com/404.php
http://localhost:8888/404.php

Hi and thanks for the answer. I have tried the relative /404.php, the full DocumentRoot of /Users/me/folder/mamp/404.php, and now, at your recommendation, the full URL of http://localhost:8888/404.php. All nothing.

Hi, yes that produced a 500 error when I added random text

Ok and are you sure .htaccess is enabled? Verify whether your .htaccess is enabled or not, by putting same garbage (random) text on top of your .htaccess and see if it generates 500 (internal server) error or not?

You need to use path either relative path from DocumentRoot OR use full URL starting with http. So use:

Your use of ErrorDocument is wrong here:

Note