Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What would be the proper HTTP status code if the agent's IP is blocked? [closed]

Tags:

http

php

I'm working on an PHP and MySQL based IP block system that is supposed to block all user agents from specific countries. Which status code should I use if an agent is blocked?

EDIT: I'll elaborate just a little more: I'm concerned about how search engines such as Google might react to it. Is there a possibility that a same search engine might crawl a page two times and get conflicting statuses on both occasions? Are, say, Google bots always "American?"

like image 997
Simon Josef Kok Avatar asked Feb 04 '15 14:02

Simon Josef Kok


People also ask

What is error 444 connection blocked?

A 444 No Response error indicates that the server has closed the connection with no returned information from a client request.

What is the status code of blocked?

The 403 (Forbidden) status code indicates that the server understood the request but refuses to authorize it. A server that wishes to make public why the request has been forbidden can describe that reason in the response payload (if any).

What is the HTTP status code 201 indicate?

The HTTP 201 Created success status response code indicates that the request has succeeded and has led to the creation of a resource.

What is the HTTP code 200 indicates?

The HTTP 200 OK success status response code indicates that the request has succeeded. A 200 response is cacheable by default. The meaning of a success depends on the HTTP request method: GET : The resource has been fetched and is transmitted in the message body.


1 Answers

For future reference, here's a big list: http://www.restapitutorial.com/httpstatuscodes.html

I'd say you can just do:

http_response_code(403);

403 is the error for forbidden.

like image 182
Scott Powell Avatar answered Nov 14 '22 22:11

Scott Powell