What is a URL redirection?
HTTP redirections, also known as url redirect, web redirect or other similar names, are a web server mechanism which allows to tell a visitor that the web page he is looking for has been moved at a different address.
Hypertext Transfer Protocol (HTTP), the protocol behind the Web, defines a list of response status codes, which are associated to each and every Response sent by webservers. These status codes are numbers which have been standardized in several RFC. For example, a successful request receives a response with a
200 status code, while a "Not found" error gets the famous
404 code. For redirection responses, the HTTP specification defines several status codes, more or less widely used:
308. All these status codes have different meanings and implications:
308are meant for permanent redirections;
307are used for temporary redirections.
Permanent vs Temporary redirections¶
Permanent and temporary redirections produce the same visible effect for the visitors, who get redirected to other pages. However, there are important differences:
- permanent redirections have a permanent effect. In other words, using a permanent redirection is the right way to indicate a client that the original content has moved to a new address, and that this change is permanent and won't change in the future. typically, web browsers will cache permanent redirections in order to speed up the content resolution, and search engines may update their indices to save the new destination URL. From a SEO point of view, permanent redirections also have the benefit of transferring the SEO weight to the destination URL.
- on the other side, temporary redirect are the right way to tell the browser that the redirection must be done, but that the content could be again available, or that its target is temporary and may change in the future. Temporary redirects do not have a SEO weight effect.
While building your redirection plan, you can either choose permanent or temporary redirections. Just keep in mind that permanent redirects are a danger zone, as a mistake cannot be undone and may damage your SEO. The counterpart is, a permanent redirect helps search engines update their database to give more weight to the new url, a phenomenon called "link-juice".
Our "rule impact" feature helps evaluate the effect of a new redirection rule. Before publishing a rule, you can check that it won't affect your real web trafic in a wrong way!
If you are unsure about the validity of a redirection rule, a good strategy might first be to create a temporary redirect and, once you have tested its effect, change the status code to choose the appropriate one.
How to choose the redirection status code?¶
The various redirection status codes do not produce the same behavior in web browsers:
301means Moved Permanently: the current request and all future requests should be redirected to the new URI, and this redirection is cacheable;
302was initially defined as Moved Temporarily (RFC 1945) but has since been redefined as "Found" (RFC 2616) in HTTP/1.1. Such a response code invites the web browser to make a second request to the target url, and allow them to rewrite
303means See Other is usually used when the server does not have a representation of the target resource. In this case, the browser must perform a
GETrequest to the target url (even if a different method was used in the initial request);
307is a Temporary Redirect and is available for requests performed using HTTP/1.1. the behavior is the same like a
302, except the method is kept. Hence, if a
POSTrequest gets a
307response, the browser will try a new
POSTmethod to the new location;
308states Permanent Redirect and has been defined quite recently, in RFC 7538, though it is compatible with most of the modern browsers.
SEO recommendations varies on the topic. From a purely technical point of view, you should now use the
308 http status codes, provided the user-agent supports it and the requests have been made using
HTTP/1.1. Otherwise, you should prefer the more classical
302, but those do not provide the same comfort for the end-user (particularly during form submissions).
As of now, the general SEO litterature and recommendations are to stick with
302 redirect codes. From a purely SEO point of view, prefer the
301 status code, keeping in mind that
301 responses are cached by web browsers, and are therefore not suitable for redirects that may change in the future.