HTTP 301 Moved Permanently
HTTP 301 indicates a permanent URL change. Learn how redirects work, how to migrate websites and preserve relevant backlinks, and how to diagnose redirect chains.
An HTTP 301 response indicates that a resource has been assigned a new permanent address. Instead of serving the requested document at the old URL, the server normally returns a Location header identifying the replacement. Browsers and other clients can follow this instruction automatically. For a website, this provides continuity between addresses: readers who arrive through bookmarks, links in articles, search results or old printed references can still reach the relevant material after a migration.
A redirect is not itself the replacement document. It is an instruction to make another request, and the quality of that destination determines whether the instruction is useful. A permanent redirect to an unrelated homepage may satisfy the HTTP protocol while failing both the reader and the search engine. Effective redirect management is therefore as much an information architecture problem as a server configuration problem.
How an HTTP 301 redirect works
The standard definition is found in RFC 9110, section 15.4.2. A typical exchange starts with a request for an old article and a response identifying its new address. The following is an illustrative HTTP/1.1 response, not a live measurement:
HTTP/1.1 301 Moved Permanently
Location: https://example.com/wiki/http-301/
Content-Length: 0
The browser requests the replacement URL separately. If that address is public and working, the new response may be 200 OK with the article itself. A client can resolve a relative Location value against the original request URI, although an absolute URL is often convenient in migration rules, especially when the domain or scheme changes. A redirect can also be cached; this is useful for a stable move but makes incorrectly deployed permanent rules harder to reverse. Explicit cache controls and testing before rollout are important.
Do not confuse an external redirect with an internal rewrite. A rewrite may route a request to a PHP controller without changing the address seen by the browser; a redirect tells the client to use a different address. A canonical link is different again: it identifies a preferred version for indexing without necessarily preventing access to alternative URLs. See the canonical URL entry for the distinction.
301, 302, 303, 307 and 308: choosing the correct status
Not every change of address is permanent. The distinction matters to clients and search systems, and for requests that submit data the behavior of the HTTP method matters too. For historical compatibility, a client following a 301 or 302 after a POST may change the subsequent request to GET. A 307 or 308 preserves the method and request body if the redirect is followed. A 303 is intended to direct a client to a separate resource, usually retrieved with GET, for example a confirmation page after a form submission.
| Code | Meaning | Method behavior | Typical use |
|---|---|---|---|
| 301 | Permanent move | POST may become GET | Article relocation, domain migration |
| 302 | Temporary move | POST may become GET | Short-lived alternative destination |
| 303 | See another resource | Retrieval, normally GET or HEAD | Confirmation after submission |
| 307 | Temporary move | Method and body preserved | Temporary API endpoint relocation |
| 308 | Permanent move | Method and body preserved | Permanent endpoint relocation |
For ordinary content pages requested with GET, 301 and 308 are both appropriate signals of a permanent change. A payment or authenticated API endpoint requires a separate review of request semantics, client compatibility and security; never apply a site-wide migration rule to such endpoints without testing. A temporary campaign, maintenance arrangement or language preference is not automatically a permanent move merely because a redirect is easy to configure. The MDN redirection guide provides additional examples.
What happens to rankings and backlinks?
In its redirect documentation, Google distinguishes permanent redirects as strong canonicalization signals from temporary redirects, which carry a weaker signal. A 301 helps the indexing system associate the previous address with the intended replacement. Google also explains in its migration guidance that permanent redirects do not inherently reduce PageRank. This does not mean that a new page inherits a guaranteed ranking, traffic volume or fixed percentage of link value.
Search systems must discover and process the move. They may evaluate the replacement page independently, particularly if its topic, language, content or site context has changed. A migration can also coincide with changes to navigation, rendering, crawl access and server capacity. These factors complicate any attempt to attribute traffic fluctuations to the status code alone. Claims that each 301 automatically loses a fixed percentage of authority, or that every old backlink always transfers its full commercial value, are misleading simplifications.
For an established publication, preserving an existing URL may be better than replacing it for cosmetic reasons. When a move is necessary, the most valuable asset to preserve is the relationship between the referring page, the reader's expectation and the destination. A link from an old industry report to a specific port directory entry should lead to that entry or a substantive replacement, not merely to a new directory homepage. A relevant restored article may be a better solution than an arbitrary redirect.
Mapping old URLs during a migration
Before changing a CMS or moving a domain, assemble an inventory from existing sitemaps, database exports, server access logs, search performance reports and known external links. Include historical URL variants and important non-HTML documents, such as PDFs, if they have incoming links or are used by readers. The inventory should preserve the complete path and meaningful query parameters; some older systems use the query string as the primary article identifier.
Classify each record by its intended outcome. An exact successor is the simplest case. Several old documents can legitimately point to one consolidated resource when that resource retains their useful information. A permanently removed page with no meaningful replacement should normally return 404 or 410 rather than falsely suggesting that the content has moved. The following mapping is fictional and illustrates different editorial decisions.
| Old request | Destination or outcome | Action | Reason |
|---|---|---|---|
/archive/guide.html | /guides/technical-seo/ | 301 | Same guide, new address |
/index.php?id=42 | /wiki/http-301/ | 301 | Known legacy article identifier |
/old-report/ | /research/transport/ | 301 only if equivalent | Substantive consolidation |
/expired-contest/ | No replacement | 404 or 410 | Resource removed |
/ro/wiki/http-301/ | Same address | 200 | Separate language version, not a duplicate to redirect |
Historical URL recovery deserves special care. Server logs can reveal requests for pages that have disappeared from the current navigation, but a request alone does not prove the former topic. Verify the historical title and content from available archives, old internal links or referring pages before creating the mapping. If a former resource cannot be reconstructed and no suitable replacement exists, an honest not-found response is preferable to guessing. For links that still bring visitors, make the replacement sufficiently substantial to answer the original need.
During rollout, update internal links to point directly to the new addresses, publish a sitemap containing the preferred new URLs and review canonical tags, structured data and language alternates. Keep the old server and its HTTPS certificates operational where a domain change is involved. Use Google's site move guidance for the appropriate Search Console procedure. Google recommends maintaining migration redirects for at least a year; keeping them longer is often worthwhile for users and persistent external links.
Implementing permanent redirects
Redirects may be managed by the web server, a CDN or the application. Choose one authoritative mapping and document which layer handles each class of request. Rules spread across several layers are difficult to debug. Examples below are intentionally limited to one fixed path; adapt them to your own configuration rather than replacing existing production rules blindly.
In Apache 2.4, an exact-path rule using RedirectMatch can be used in an appropriate virtual host or permitted .htaccess context:
RedirectMatch 301 ^/archive/guide\.html$ https://example.com/guides/technical-seo/
On Nginx, an exact location in the appropriate server block can return the permanent response:
location = /archive/guide.html {
return 301 https://example.com/guides/technical-seo/;
}
An application that maintains a database of historical routes can perform the same operation. For example, in PHP, when the request has already been matched to a trusted mapping, send the response before any output:
header('Location: https://example.com/guides/technical-seo/', true, 301);
exit;
These examples assume the target is a fixed trusted URL. Never use an arbitrary user-supplied address as a redirect target without validating it against an appropriate policy: an open redirect can be abused to disguise misleading links. For rules based on query parameters or captured path components, test encoding, preservation of meaningful parameters and removal of unwanted ones explicitly. The examples do not establish a uniform query-string policy across different server modules. Review the Nginx return documentation and PHP header documentation for implementation details.
Chains, loops and broken destinations
A chain occurs when the replacement address redirects again. Consider a move from HTTP to HTTPS, followed by a change of hostname and finally a change of path. If each layer acts independently, a single visit can produce three redirect responses before loading the document. On the server and the network this introduces additional work, while clients and crawlers have finite limits on the number of redirects they will follow. A loop occurs when a rule eventually leads back to a previously visited address. In that situation the intended document never arrives.
| Observed result | Interpretation | Corrective action |
|---|---|---|
| 301 → 200 | Direct move; destination responds | Check content relevance and indexability |
| 301 → 301 → 200 | Unnecessary intermediate hop | Point the first rule to the final address |
| 301 → 404 | Missing replacement | Restore the target or correct the mapping |
| A → B → A | Redirect loop | Resolve conflicting rules |
| 301 → 200, unrelated homepage | Protocol works, intent fails | Find a relevant successor or return a genuine 404/410 |
| 301 → 200, noindex | Accessible target, excluded from indexing | Review intended indexing policy |
Diagnose individual URLs with the SEOsite Redirect Checker or a command-line HTTP client. The following command follows redirects with a GET request, prints response headers from each hop and discards the downloaded body:
curl -sS -L --max-redirs 10 -D - -o /dev/null https://example.com/archive/guide.html
A HEAD request is convenient for quick inspections, but some systems handle HEAD differently from GET. Test the actual request method where behavior matters, and check the final URL and the document, not just the first status. Use Google's HTTP status documentation to understand how its crawlers process common responses.
Measuring a migration and maintaining multilingual URLs
Monitor old and new addresses separately in access logs, check the number of unexpected 404 and 5xx responses, and compare search impressions and clicks for the mapped page groups. One useful internal quality metric is the share of intended permanent moves that reach the expected final URL directly with a successful response. For example, if 920 of 1,000 tested mappings meet that definition, the direct-success rate is 92%. Investigate the other 80 individually rather than assuming that a high overall rate excuses failures on important pages. This metric is a testing measure, not a search engine ranking factor.
For multilingual websites, maintain a stable URL for each language and connect corresponding pages through language annotations. A Romanian article and its English original serve different readers even when their slugs match. Both should remain independently accessible; a permanent redirect from one language to another would remove that choice. Review the localization guide and Google's localized versions documentation. The same principle applies to AI-assisted discovery: old source links should still resolve to the relevant document, but a redirect cannot force a generative system to update stored knowledge or cite a new address. See GEO for the distinction between access and citation.
In short, use a 301 when an address has genuinely changed permanently. Map the old resource to the closest useful successor, eliminate unnecessary hops, test the result and retain the mapping while people and systems still rely on it. Redirects are an infrastructure mechanism for maintaining continuity, not a shortcut for creating relevance.