I am running Apache 2.4.2 on my local server. My website's
.htaccess file is as follows:
DirectoryIndex home.php Options -Indexes ErrorDocument 404 /404.php
This works great at displaying an HTTP 404 page when you try to access a non-existent file in the browser, but it is not showing the error page when accessing existing files using the following syntax:
For example, if I go to
home.php page loads, but all the relative links in the HTML are broken. I don't have a
home.php directory on my server! What's going on?
Is there a directive or rule I can add to my
.htaccess file to stop this behavior and throw an HTTP 404 error instead?