http status code 404 - how can I send response 404? -
I have a page when it loads, then check it first in the database if the page exists. The problem is that if the page does not exist, the page loads with the response 200. Is there a way to send header response 404 from the HTML page? Or can I call a function in CGI who will do this? Thanks!
I agree that your page is not just HTML as you do in your database.
All you need to do is send an HTTP header 404: (example in PHP)
& lt ;? Php ob_start (); // Turn on the Outdoor buffering, to ensure that nothing is sent before the header (your code) ob_end_clean (); // Clear Output Buffer Header ("HTTP / 1.0 404 not found"); Send // Header? & Gt;
Comments
Post a Comment