← Back to status codes
HTTP Status Code
301 Moved Permanently
RedirectionThe requested resource has been permanently moved to a new URL.
HTTP status code reference, response example, common causes, fixes, and related status codes.
What does HTTP 301 Moved Permanently mean?
HTTP 301 Moved Permanently is a status code sent by a server to indicate the result of an HTTP request.
Status codes help browsers, APIs, apps, and backend systems understand whether a request succeeded, failed, was redirected, or needs additional action.
In practice, HTTP 301 Moved Permanently usually appears when a server responds under specific request, validation, permission, or infrastructure conditions.
Response example
HTTP/1.1 301 Moved Permanently Location: https://example.com/new-url
HTTP example
HTTP/1.1 301 Moved Permanently
Relevant headers
Location
Location: https://example.com/new-url
Common causes
- Website migration
- Canonical URL change
- Permanent redirect setup
How to fix it
- Update internal links to the new URL
- Verify the Location header points to the correct destination
Common mistakes
- Assuming the status code alone explains the full backend issue
- Ignoring related response headers that add important context
- Treating temporary errors as permanent failures
- Retrying too aggressively without checking the cause
- Debugging the frontend only when the problem is server-side
How browsers and APIs use it
Browsers, APIs, and backend services use HTTP status codes to understand the outcome of a request. Depending on the status code, an application may render content, retry a request, redirect the user, show an error, or trigger a different flow in the client or server.
Developer note
Use 301 for permanent redirects, especially after changing URL structure or moving pages for SEO reasons.
Client-side example
const response = await fetch("/old-page", {
redirect: "manual",
});
if (response.status === 301) {
console.log("Permanent redirect detected");
}