Junior — Middle
Can you explain the meaning of code 301 in an HTTP server response?
sobes.tech AI
Answer from AI
HTTP response code 301 means "Moved Permanently" — the resource has been permanently moved to another URL.
When the server returns 301, it informs the client (browser or other agent) that the requested resource is now available at a new address specified in the Location header.
This is important for SEO and caching, as search engines update links, and browsers may automatically redirect the user.
Example of a response header:
HTTP/1.1 301 Moved Permanently
Location: https://newsite.example.com/newpage
As a result, the client should make a new request to the specified address.