I currently have an ErrorDocument directive defined inside my .htaccess file:
ErrorDocument 404 /site/error.php
Now if I go to a non-existent page like this on my site it works fine:
http://mysite.com/p
However if I try go to a non-existent directory, the directive doesn't work
http://mysite.com/random/hello
tries to find the document:
http://mysite.com/random/site/error.php
which of course doesn't exist. I've searched online and all sources indicate the second example above should go to the correct file (because the leading / in the directive makes it relative to the web root), but this is apparently not the case.
I am running on Ubuntu, thanks!