HTTP status codes
What are HTTP status codes, what they mean, and how to change the code used for redirects
Premium Feature
What is HTTP status code?
HTTP status code is a 3-digit number returned by the server when it responds to an HTTP request. This code tells the client (usually your browser) what the response means and, occasionally, what you should do next.
Known HTTP status codes are arranged in ranges defined by the first digit, namely:
1xx
(informational responses)2xx
(successful handling of the request)3xx
(redirection response)4xx
(client error)5xx
(server error)
When it comes to shortened URLs, the relevant ones are the 3xx
family of codes. They are returned by the redirection engine at once.to to the visitor of the link to instruct them to proceed to another, original URL.
For the sake of this article we’ll only look to these, relevant, 3xx
codes.
Why is HTTP status code important?
Different codes from the 3xx
family convey a slightly different meaning, which influences how they are handled.
The most commonly used are the following ones:
301 Moved Permanently
indicates the resource will always be at the redirection address.302 Found
(sometimes called “Moved temporarily”) means the redirection is temporary, so the same source URL might potentially result in a different target address under different conditions.303 See Other
is similar to302 Found
in its meaning.307 Temporary Redirect
represents a modernised version of the302 Found
code.308 Permanent Redirect
is very similar to301 Moved Permanently
, but is also more modern.
There are the two most notable effects on short links arising from different redirection codes.
Caching behaviour
Redirections of 301
and 308
are usually cached by the browser, meaning going to the same short URL for the second time will not trigger a request to server. In other words, once your browser knows where to go, it will remember it until the cache expires.
302
and 307
, on the contrary, do not get cached and will result in a server request for each redirection.
Practically, this means that using the 301
/308
codes may skew your statistics (repeated visits might not be counted) and may not have the desired effect when combined with expiring/future links, passwords, or redirection rules, especially when it comes to probability testing (A/B testing).
Impact on SEO
Another important thing to bear in mind is only the 301
and 308
codes are considered to be “SEO-safe” — because they are permanent. The usage of temporary redirection codes will most likely negatively impact your link ranking by search engines.
Default behaviour
Each short link is initially created with its HTTP status code
set to Default
.
This default behaviour is as follows:
- When a link has a Start date, an Expiry date, or any Rules, it’s considered changeable and will therefore redirect using the
302 Found
code. - When a link is password-protected, it will also redirect with
302 Found
to prevent the browser from caching the “protected” target URL. - For all other cases once.to will redirect the visitor with the “SEO-safe”
301 Moved Permanently
code.
Customizing the status code
It is possible, however, to explicitly choose any of the above codes using the Link properties dialog:
To revert the link to its default behaviour, select Default
from the dropdown.
Tags: HTTP, link, permanent redirect, premium feature, redirect, SEO, short link, short URL, status code, temporary redirect, URL