What are server codes?
In order to really understand how to set up a 301 redirect on your website, you first need to understand what are server codes. "301" is, in fact, only one of several execution codes that are sent by any web server each time somebody is requesting a file. This code, present as the head information of any server communication, helps your browser to know if the request it just made is successful or not.
Many types of codes can be answered by a web server to a request. Most famous one is 404, indicating that a file cannot be found. But each code has its own signification. You'll find next a list of the most common server codes that you can find on the web with their precise definition. Keep this page as a reference when you encounter some abnormal answer from a website:
- 200: The request is successful; the data of the file requested follow.
- 201: The request results in the creation of a new file, which is successful.
- 202: The request has been accepted by the server. But no information is available to know if it achieved successfully or not.
- 301: The file requested has been moved permanently to another location. The new location is defined as part of the following information sent by the server.
- 302: The file requested has been moved temporarily to another location. The new location is defined as part of the following information sent by the server.
- 401: An authentification is necessary to access the requested address. This code will mostly result of the display of a login/password box in the browser interface of the visitor.
- 403: Visitor is not authorised to access the requested address. This code can be the result of bad login/password information after a 401 error code.
- 404: The file requested on the server cannot be found at the specified address. 404 is the most common error you will encounter on the web.
- 410: The file requested had been removed from the server and is not expected to be released again. This code is used to notify the end of the content and the will to remove all links pointing to it.
- 414: The requested address is too long and can not be managed by the server.
- 503: The server is presently suffering too much connexion and cannot handle your request at the moment.
- 504: Timeout. The delay the server takes to answer the request is too long and results to a cancellation of it.