Php page not found ← (PHP)
Solution:
Create .htaccess file in root folder and add following code :
RewriteEngine on
ErrorDocument 404 http://siteurl.com/404.php
Create 404.php in root folder
<?php
// Add your 404 page error page content or layout
echo "This page is not found. Please enter valid URL";
?>
Let's Check its working
http://siteurl.com/mypage.php
// considering this page is not existing you should get 404 page
Answer
Solution:
The problem was that the .htaccess file was in the root folder of the
project and not the htdocs folder
Source