Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why is it bad to have 200 OK header status at 404 error page?

I have an issue I'm having trouble :/ err404 page's 200OK header status problem, although it should be 404 header. what is wrong with having 200 OK? is there really anything like that 200 OK should be at 404 error page header status?

appreciate advises!! thanks a lot!


i guess it has sth to do with .htaccess. here is my .htaccess file;

ErrorDocument 404 /err404.html

RewriteEngine On

RewriteRule ^login.html$ index.php?s=login&a=loginDo [QSA,L]
RewriteRule ^logout.html$ index.php?s=login&a=logoutDo [QSA,L]
RewriteRule ^([^/]*).html$ index.php?s=$1 [QSA,L]
RewriteRule ^members/([^/]*)$ index.php?s=profile&username=$1 [QSA,L]
RewriteRule ^([^/]*)/$ index.php?s=listing&search[cityString]=$1 [QSA,L]
RewriteRule ^([^/]*)/([^/]*)/$ index.php?s=listing&search[neighborhoodString]=$2 [QSA,L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*).html$ index.php?s=details&seo_friendly=$3 [QSA,L]

i also have some more trouble related to this htaccess file :(

Question 1; when url is like http://localhost/fdfcdcvdvdvbdf.html (not exist url), it redirects to homepage, but it should redirect to err404.html. Any idea about the problem? err404 redirection works well in case of url like http://localhost/fdfcdcvdvdvbdf.ht or http://localhost/fdfcdcvdvdv

Question 2; How can I fix this 200 OK problem :/

like image 923
designer-trying-coding Avatar asked Nov 28 '22 00:11

designer-trying-coding


1 Answers

The 404 value is not just a Christmas tree decoration -- it conveys real information about the url in question, namely, that it doesn't exist. Sending a 200 page that describes the fact that the page doesn't exist is a completely different thing, particularly for a program, as opposed to a human.

like image 112
Peter Rowell Avatar answered Dec 05 '22 21:12

Peter Rowell