Forum Moderators: coopster
For example, a page URL is htt p://www.site.com/info.php?id=123
When the DB query for id=123 returns nothing, I will redirect user to a custom 404 page, by using the following method:
header("Location: /404.html");
The correct method is
header ("HTTP/1.0 404 Not Found");
But it will bypass my custom 404 page defined in .htaccess
If you use
header ("HTTP/1.0 404 Not Found");
header("Location: /404.html");
it will still be a 302 header! So, is there a way to send a 404 header and redirect to a custom 404 page inside php source code?