A 301 redirect is an HTTP status code that tells a browser or search engine that a web page has been permanently moved to a new URL. When a visitor requests the old address, the server responds with a 301 and the new location, and the browser automatically requests the new page, typically without the visitor noticing anything beyond a brief delay.
What the 301 Status Code Means
HTTP status codes are three-digit numbers grouped by purpose. Codes in the 300–399 range indicate redirection. The 301 code specifically means “Moved Permanently.” It is defined in the HTTP specification, and its semantics are well established: the requested resource has been assigned a new permanent URI, and any future references to the old URI should use the new one.
A 301 is not a command that moves files. It is a message from the server to the client. The server still receives the request for the old URL and must be configured to respond with the redirect. The actual content lives at the new URL; the old URL simply points to it.
This matters because the redirect only works as long as the old URL’s server is reachable and configured correctly. If the old domain expires or the server stops responding, the redirect disappears.
How the Redirect Happens: Step by Step
The process is a short conversation between the browser and the server. Here is the sequence:
- Request: A visitor types or clicks the old URL. The browser sends an HTTP request to the server hosting that address.
- Response: The server, configured with a redirect rule, replies with a 301 status code and a
Locationheader containing the new URL. - Follow: The browser reads the
Locationheader and automatically sends a new request to the new URL. - Delivery: The server at the new URL responds with the page content, usually a 200 OK status. The visitor sees the new page.
Search engine crawlers follow the same steps. When a crawler encounters a 301, it notes that the old URL now points to the new one and typically transfers the ranking signals associated with the old page to the new page over time.
The redirect is invisible to most users except for the address bar changing. Some browsers cache 301 responses, meaning they may remember the redirect and skip the old URL entirely on future visits. That caching behavior is why 301s are considered permanent and why they should not be used for temporary moves.
Why Search Engines Treat 301s Differently
Search engines use redirects to keep their indexes clean. When a crawler sees a 301, it understands that the old URL is no longer the canonical address. The new URL becomes the page that appears in search results. Over time, most of the old page’s ranking signals—links, authority, relevance—are consolidated onto the new URL.
This is why 301s are the standard choice when permanently changing a URL structure, migrating to a new domain, or merging duplicate pages. A temporary redirect, such as a 302 or 307, signals that the move is not permanent, and search engines may keep the old URL indexed.
It is a common misconception that a 301 redirect instantly transfers all ranking power. In practice, search engines need to recrawl the old URL, process the redirect, and then recrawl the new URL. This can take days or weeks depending on crawl frequency. The old URL may remain in search results for a short period before being replaced.
Common Situations That Call for a 301
Redirects are used whenever a URL changes permanently. Typical scenarios include:
- Domain changes: Moving a site from an old domain to a new one.
- URL restructuring: Changing permalink patterns, such as from
/page?id=123to/category/page-name. - HTTPS migration: Redirecting all HTTP URLs to their HTTPS equivalents.
- WWW vs. non-WWW: Standardizing on one version of the hostname.
- Deleted pages: Pointing an old page to the most relevant surviving page, such as a category page, rather than letting it return a 404 error.
- Merging content: Combining two similar pages into one and redirecting the retired URL to the survivor.
In each case, the redirect preserves the user experience and avoids broken links. It also helps search engines understand that the content has moved rather than disappeared.
How to Implement a 301 Redirect
The method depends on the server and platform. On an Apache server, redirects are typically configured in an .htaccess file using the Redirect or RewriteRule directives. On Nginx, they are set in the server block with the return 301 or rewrite directive. Content management systems often provide plugins or built-in tools for managing redirects without editing server files.
Regardless of the tool, the key details are the same:
- The old URL must be the one that receives the request.
- The response must include the 301 status code and a
Locationheader with the full new URL, including the protocol and hostname. - The new URL should be the final destination, not another redirect, to avoid chains.
- Test the redirect with a tool that shows HTTP headers, or use the browser’s developer tools network panel.
A redirect chain—where A redirects to B, and B redirects to C—adds latency and can dilute the transfer of ranking signals. It is better to point the old URL directly to the final destination.
Common Problems and How to Spot Them
Redirects can go wrong in predictable ways. Here are the most frequent issues:
- Redirect loops: A URL redirects to itself or to another URL that redirects back, causing the browser to give up with an error. This usually happens when rules conflict, such as redirecting both HTTP to HTTPS and HTTPS to HTTP.
- Chains: Multiple hops slow down the request and can confuse crawlers. Consolidate to a single redirect.
- Wrong status code: Using a 302 when the move is permanent, or a 301 when the move is temporary, sends the wrong signal to search engines.
- Missing redirects: Not every old URL is covered, leaving some visitors and crawlers hitting 404 errors.
- Cached redirects: Browsers may hold onto a 301 long after the rule is removed, making testing confusing. Clearing the browser cache or using a private window helps.
Regularly auditing redirects after a site change is good practice. Crawling the old URL list and checking the response codes catches problems early.
301 vs. Other Redirect Codes
Not all redirects are the same. The status code tells clients how to treat the move:
- 301 Moved Permanently: The resource has a new permanent URL. Clients and search engines should update references.
- 302 Found: A temporary redirect. The old URL should remain the canonical reference.
- 307 Temporary Redirect: Similar to 302 but preserves the original request method (e.g., POST stays POST).
- 308 Permanent Redirect: Similar to 301 but preserves the request method. Less commonly used but appropriate when method preservation matters.
For most website moves, 301 remains the standard because it is widely supported and clearly signals permanence. The choice between 301 and 308 depends on whether the original request method must be preserved, which is rarely a concern for ordinary page views.
Frequently Asked Questions
Does a 301 redirect affect SEO negatively?
No, when used correctly. A 301 tells search engines that the page has moved permanently, and ranking signals are generally transferred to the new URL over time. Problems arise from chains, loops, or redirecting to irrelevant pages, not from the 301 itself.
How long does a 301 redirect take to be recognized by search engines?
It varies. Search engines need to recrawl the old URL and then the new one. This can take days to weeks depending on how often the site is crawled. There is no fixed timeframe, and the old URL may appear in results briefly during the transition.
Can I use a 301 redirect for a temporary move?
It is not recommended. A 301 signals permanence, and browsers may cache it for a long time. For temporary moves, use a 302 or 307 so that the old URL remains the canonical reference.
What happens to the old page’s backlinks after a 301?
Backlinks pointing to the old URL are generally credited to the new URL as search engines process the redirect. The transfer is not always complete or immediate, but the intent of a 301 is to consolidate link equity on the new address.
Do I need to keep the old domain to maintain a 301?
Yes. The redirect is served by the server that hosts the old URL. If the old domain expires or its server stops responding, the redirect stops working. Keeping the old domain registered and configured is necessary for the redirect to remain active.
Can a 301 redirect point to a different domain?
Yes. The Location header can contain any absolute URL, including one on another domain. This is common when migrating to a new domain name. The redirect rule on the old domain’s server handles the cross-domain jump.