A guide for human beings – HTTP codes
AgentSlug.com is meant to be so simple that anyone can use it without any trouble.
However, there are some kind of technical terms you should actually know to understand what’s going on with your website.
This article is not for technical people, it simplifies many complicated issues.
How does it work and why it matters?
Imagine you are looking for some company document. You know it probably exists, but you don’t really know where exactly. You just know its name. Let’s say it’s a Holiday Funding Request Form*
First thing you do is you call your colleague who works here longer than you and knows everyone. He tells you that you should call a guy from HR department. The HR guy redirects you to Finances. You go there, and you are told to be back in couple of minutes, because they are doing some maintenance and can’t serve you now.
After a couple of minutes you go back and get the proper form.
Machines works almost the same way. URLs are something like names. Unified names with whole addresses.
When you type an URL and hit the enter key, your browser sends a request to a DNS server. DNS is you friend who knows everyone or knows people who know people. DNS routes your browser to a proper server by resolving the domain name to a related IP number. Sometimes the first DNS knows the name and knows the IP. Sometimes it has to ask other DNS .
Then your request is routed to a proper server by the IP address. If the server is up and responding, it should send some response to your browser.
When the URL matches any document on server, response should contain HTTP 200 “OK” code. It means “everything is fine, here’s what you are looking for”.
If the server is down for maintenance, it should send you an HTTP 503 response. Translation of this code to the human language is “sorry, we have some issue over here, come back later”.
If the server can’t find the document, but knows where you should go to find it, it will redirect you (your browser) by sending an HTTP 301 code which means “there’s nothing here, the resources were moved to another location, you should go somewhere else”.
So, why does it matter?
Machines communicate in a human-like way. They were made by humans and they are similar to humans in many dimensions.
The same story is when machines speak to each other. We noticed that some websites in the maintenance mode, send HTTP 200 code with a nice “be right back” landing page. If one of the Google indexing crawlers came there during this pseudo-maintenance mode, it would identify the landing page as a regular page and switch the indexed page with the maintenance notice.
* In many EU countries, companies can participate in employees’ vacation.