HTTP status codes for an unbroken URL

I need to determine if the URL entered by the site user has been violated. Essentially, this means that it provides a page that an anonymous user can view.

I have seen examples that say "if url returns 200" or "if URL does not return 404" as the methods used. Say, for example, it returns 301 or 403. They are very similar (in the definition I use here), to 200 and 404, respectively.

What is the best way to verify the correct URL based on http status codes?

+3
source share
4 answers

, 400, "". 300 .

+2

URL, - 200, , 203.

+1

, URI "", . , , URI.

. , 404, , 200 . . (5xx), . .

0

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


All Articles