*** Welcome to piglix ***

HTTP 301


The HTTP response status code 301 Moved Permanently is used for permanent URL redirection, meaning current links or records using the URL that the response is received for 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 states that:

Client request:

Server response:

Here is an example using a .htaccess file to redirect a non-secure URL to a secure address without the leading "www":

Here is an example using a PHP redirect:

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.



...
Wikipedia

...