Is it normal for a website to return an HTTP code of 200 for a page not found (404)?

I did some testing with some sites (I will not mention this), and they return 200 code when pages are not found. Is it against any web development standard?

This is the code I use to see the URL return code:

System.out.println(new String("getRespCode=" + urlConnection.getResponseCode() + ", HttpURLConnection=" + HttpURLConnection.HTTP_OK + "\n"));

Any ideas?

+3
source share
5 answers

This is called Soft 404or False 404. There is a detailed discussion on Wikipedia . This is not allowed by any web standard (and I don’t know a single argument in favor), but it is also invalid HTML.

+8
source

. , 404 ​​ , , 200.

+1

, . , ,

+1

, . Thats, , .

, ; , .

phihag , .

0

, true 404 ( ) , FileNotFoundException.

0

Source: https://habr.com/ru/post/1705681/


All Articles