HTTP 301

It is used for permanent redirecting, meaning that links or records returning this response should be updated.

The new URL should be provided in the Location field, included with the response.

The 301 redirect is considered a best practice for upgrading users from HTTP to HTTPS.

RFC 2616[1] states that: Client request: Server response: To fix problems with non-existing files or directories using a distributed .htaccess file: Here is an example using a .htaccess file to redirect a non-secure URL to a secure address without the leading "www": A custom directory redirect, using an index.html file: Here is an example using Perl CGI.pm: Here is an example using a PHP redirect: Here is one way to redirect using Express.js: Equivalently simple for an nginx configuration: Both Bing and Google recommend using a 301 redirect to change the URL of a page as it is shown in search engine results, providing that the URL will permanently change and is not due to be changed again any time soon.

[2][3] The HTTP 301 status code has several technical nuances that developers should be aware of when implementing and managing redirections: