I added a custom error page 404.php to my website and I added it to my .htaccess but when I call a page which does not exists the website goes to the home page (index.php) instead of my 404.php.
404.php
<?php
http_response_code(404);
echo "error";
?>
My .htaccess
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^(.*)\.linkedfilm\.com$ [NC]
RewriteRule ^(.*)$ https://www.website.com/$1 [R=301,L]
ErrorDocument 404 https://www.website.com/404.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^home$ index.php?link1=home [QSA]
Thanks