If you want to use a custom error-page, I’ve read you have to pass the error-status.
Does that require something specific in your error.php?
Or do you only have to put this lines in your .htaccess? At the bottom, on top, does not matter?
ErrorDocument 400 /error.php
ErrorDocument 401 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php
ErrorDocument 500 /error.php
Is it possible to make the error-page appear on a page like list.php?id=5 where id=5 doesn’t exist anymore (but id=3 or something still does exist)?
I now use php header location, but this probably won’t make the non-existing id’s/pages disappear in search engine results?
I use a php-page that takes data from a table (mysql db) with a GET id in the URL (list.php?id=1).
I deleted some rows in that table since the renewal of the website: but that specific page still appears in search engine results.
list.php?id=5 does not exist anymore, so it would show an ‘empty’ page.
After a mysqli_num_rows check, I use <?php header ('Location: http://www.domain.com'); ?> to redirect if that ‘id’ does not exist anymore.
But this will probably not make this specific page (for example: “list.php?language=en&id=5” or “en/list/5”) disappear in search engine results?