Redirects are an essential part of website management, technical SEO, content migration, and web application development. They automatically send users and search engines from one URL to another when a page has moved, a website structure has changed, or content is temporarily unavailable.
Two of the most commonly used HTTP redirect status codes are 301 and 302.
Although both redirects send visitors to a different URL, they communicate different intentions:
- A 301 redirect indicates that the move is permanent.
- A 302 redirect indicates that the move is temporary.
This distinction matters because browsers, search engines, caching systems, and other HTTP clients may treat permanent and temporary redirects differently.
Using the wrong redirect can cause search engines to retain the wrong URL in their index, delay a website migration, confuse canonicalization signals, create redirect chains, or send users to outdated content.
This guide explains the difference between 301 and 302 redirects, their SEO impact, when to use each status code, how they compare with 307 and 308 redirects, and how to implement and test them correctly.
What Is an HTTP Redirect?
An HTTP redirect is a server response that instructs a browser, search engine crawler, or other client to request a different URL.
When a user requests a redirected page, the server responds with a status code in the 3xx range and normally includes a Location response header containing the destination URL.
A simplified redirect response may look like this:
HTTP/1.1 301 Moved Permanently
Location: https://www.example.com/new-page
The browser receives the response and requests the new URL automatically.
From the user’s perspective, this may happen almost instantly. However, the status code provides important information to search engines and technical systems about whether the change should be considered permanent or temporary.
The most common HTTP redirects include:
301 Moved Permanently302 Found303 See Other307 Temporary Redirect308 Permanent Redirect
All of these status codes redirect the client to another resource, but they differ in permanence and in how they handle HTTP request methods such as GET and POST.
What Is a 301 Redirect?
A 301 redirect, officially called 301 Moved Permanently, indicates that a resource has permanently moved to another URL.
Example:
https://www.example.com/old-page
may permanently redirect to:
https://www.example.com/new-page
The redirect tells users, browsers, search engines, and other clients that the old URL should no longer be treated as the primary location of the content.
Google describes permanent redirects such as 301 and 308 as signals that the redirect destination should become the canonical URL and generally appear in search results instead of the source URL.
A 301 redirect is normally appropriate when:
- A page has permanently moved.
- A URL structure has changed.
- A domain has been replaced.
- HTTP URLs are moving permanently to HTTPS.
- Several duplicate URLs need to consolidate into one preferred URL.
- Two articles or product pages have been merged.
- A product has been permanently replaced by a close equivalent.
- A website is changing from a non-www domain to a www version, or vice versa.
Once implemented, the redirect should remain in place for as long as users, external links, bookmarks, or search engines may continue requesting the old URL.
What Is a 302 Redirect?
A 302 redirect, officially called 302 Found, indicates that a resource is temporarily available at another URL.
For example, a website may temporarily redirect:
https://www.example.com/service
to:
https://www.example.com/service-maintenance
while maintenance is being performed.
The original service URL remains the intended permanent location. Once maintenance is complete, the redirect should be removed and the original URL should serve its normal content again.
Google classifies 302, 303, and 307 redirects as temporary redirects. Googlebot follows them, but the redirect itself is not normally used as a signal that the destination should replace the original URL as the canonical version.
A 302 redirect is normally appropriate when:
- A page is temporarily unavailable.
- A short-term campaign redirects users to a temporary landing page.
- An A/B test sends some users to an alternative URL.
- A service is undergoing temporary maintenance.
- A product is briefly out of stock but will return.
- A website temporarily routes users to a regional or promotional page.
- The original URL should remain indexed and return in the future.
The key question is not how long the redirect will last in exact days or weeks. The key question is whether the original URL is expected to return as the primary location.
301 vs 302 Redirect: The Main Difference
The fundamental difference between 301 and 302 redirects is intent.
A 301 says:
This content has permanently moved. Use the new URL from now on.
A 302 says:
This is a temporary alternative. Keep the original URL as the main location.
| Feature | 301 Redirect | 302 Redirect |
|---|---|---|
| Official name | 301 Moved Permanently | 302 Found |
| Intended duration | Permanent | Temporary |
| Canonical signal | Destination should become canonical | Source normally remains canonical |
| Search result URL | New URL is generally preferred | Original URL is generally retained |
| Common use | URL migration | Temporary page change |
| Domain migration | Recommended | Not recommended |
| Website maintenance | Usually inappropriate | Appropriate |
| A/B testing | Not recommended | Recommended |
| Method preservation | Not guaranteed for POST | Not guaranteed for POST |
| Modern method-preserving alternative | 308 | 307 |
Choosing between them should be based on whether the move is genuinely permanent or temporary — not on assumptions that one status code is “stronger” or “better for SEO.”
How Do 301 and 302 Redirects Affect SEO?
Redirects influence several parts of search engine optimization, including URL discovery, indexing, canonicalization, link signals, crawl efficiency, site migrations, and user experience.
SEO Impact of a 301 Redirect
A correctly implemented 301 redirect tells search engines that the old URL has permanently moved.
Google may use the redirect as a canonicalization signal and begin replacing the old URL with the destination URL in its index. This process is not necessarily immediate. Google must crawl the old URL, follow the redirect, evaluate the target, and process the associated signals.
During major migrations, rankings and traffic may fluctuate temporarily while search engines recrawl and reindex the affected URLs.
Google states that 301 redirects and other permanent redirects do not cause a loss of PageRank. However, the redirect should point to a relevant equivalent page, and the destination should be indexable and return a successful response.
A permanent redirect works best when the old and new pages have the same or very similar intent, each old URL maps directly to its most relevant replacement, the destination returns HTTP 200, internal links are updated to use the new URL, canonical tags point to the new URL, XML sitemaps contain the new URL, and redirect chains are avoided.
SEO Impact of a 302 Redirect
A 302 redirect communicates that the destination is temporary and that the original URL should generally remain the primary URL.
Googlebot can follow the redirect and access the temporary destination, but Google does not normally treat the 302 itself as a signal that the target should replace the source as canonical. The target may still be indexed if other canonicalization signals support it, but that is not the primary purpose of a temporary redirect.
This makes a 302 useful when you need to redirect users without permanently changing which URL search engines associate with the content.
For example, suppose a high-ranking product category is temporarily redirected to a maintenance notice. A 301 would communicate that the maintenance notice is the permanent replacement. A 302 communicates that the original category remains the intended long-term URL.
Does a 302 Redirect Pass Link Equity?
The common statement that “301 passes link equity but 302 passes none” is too simplistic.
Modern search engines use multiple signals to interpret redirects and canonical URLs. Google’s documentation focuses on whether the redirect is a permanent or temporary canonicalization signal rather than describing 302 redirects as transferring absolutely no value.
The practical SEO difference is this: a 301 asks Google to consolidate the old URL into the new URL, while a 302 asks Google to keep the original URL as the primary version.
When the move is permanent, use a permanent redirect. Do not use a 302 simply because you are afraid that a 301 will lose PageRank. Google specifically states that permanent redirects do not cause PageRank loss.
When Should You Use a 301 Redirect?
1. Permanently Changing a Page URL
If you rename /blog/seo-tips-2025 to /blog/technical-seo-tips and the old URL will never return, use a 301 redirect. This preserves access for users who saved the old link and helps search engines understand the permanent change.
2. Moving to a New Domain
When migrating from oldexample.com to newexample.com, each old URL should redirect to its corresponding new URL — not to the homepage. Redirecting every old page to the homepage removes topical relevance and Google may treat such redirects as soft 404s.
3. Moving from HTTP to HTTPS
When a website permanently adopts HTTPS, each HTTP URL should redirect to its exact HTTPS equivalent. Avoid redirecting every HTTP page to the HTTPS homepage.
4. Consolidating WWW and Non-WWW Versions
A website should have one consistent host version. Either https://example.com redirects to https://www.example.com or vice versa — the important point is consistency across redirects, canonical tags, internal links, sitemaps, and hreflang annotations.
5. Fixing Trailing-Slash or Case Variations
URLs such as /example-page, /example-page/, and /Example-Page may be treated as different addresses. When only one should be accessible, permanent redirects can consolidate the alternatives into a single preferred URL.
6. Merging Similar Content
After combining two articles that cover nearly identical topics into one stronger resource, the removed article can be redirected permanently to the consolidated page. The destination should satisfy the same search intent.
7. Replacing a Discontinued Product
A discontinued product page may be redirected to a very close replacement when the new product genuinely serves the same need. If there is no relevant replacement, returning a proper 404 or 410 may be more appropriate than redirecting users to an unrelated category or homepage.
When Should You Use a 302 Redirect?
1. Temporary Website Maintenance
If a page or service will return after maintenance, a 302 can temporarily direct users to an explanatory page. Once maintenance is complete, remove the redirect and restore the original page.
2. A/B Testing
When users are temporarily sent from an original page to a test variation, Google recommends using a 302 rather than a 301. This communicates that the test URL is temporary and that the original page should remain the preferred version. Google also recommends using rel="canonical" on alternative test URLs when several URLs are involved.
3. Temporary Promotional Campaigns
A homepage may temporarily redirect users to a seasonal campaign or announcement page with a 302. However, a banner, modal, or prominent internal link may often be a better solution than redirecting the homepage.
4. Temporary Product Unavailability
If a product is temporarily unavailable but expected to return, do not permanently redirect its URL. A 302 may temporarily send users to a stock notification page or category. In many ecommerce situations, keeping the product page live with an out-of-stock message is even better — users can still access product details, reviews, and restock information.
5. Temporary Regional Routing
Applications sometimes temporarily route users to different regional experiences. Where possible, provide language or country selectors and use correct hreflang implementation rather than forcing every user through a redirect.
6. Temporary Service Routing
Applications sometimes send users to different servers, login screens, or queue pages based on temporary conditions. A 302 may be appropriate when the original URL remains the permanent endpoint and the routing decision may change later.
What Happens When You Use the Wrong Redirect?
Using a 302 for a Permanent Move
If a permanent URL change is implemented with a 302, search engines may continue treating the old URL as the primary version. Possible consequences include the old URL remaining in search results, delayed consolidation of indexing signals, conflicting canonical signals, slower domain or URL migration, and search engines repeatedly crawling the old URL.
Search engines may eventually interpret a long-lasting temporary redirect differently when other signals strongly indicate a permanent move, but website owners should not depend on that behavior.
Using a 301 for a Temporary Move
If a temporary change is implemented with a 301, search engines may begin replacing the original URL with the temporary target. Possible consequences include the temporary URL appearing in search results, the original URL losing its canonical status, and A/B testing pages being interpreted as permanent replacements.
A mistakenly cached permanent redirect may also make troubleshooting more difficult for users who continue seeing the redirect after it has been removed from the server.
301 vs 302 vs 307 vs 308 Redirects
The distinction between 301 and 302 is mainly permanence, but HTTP request method behavior is also important. Historically, browsers often changed a redirected POST request into a GET request when following a 301 or 302 response. The 307 and 308 status codes provide clearer method-preserving behavior.
| Status Code | Permanent or Temporary | May Change POST to GET |
|---|---|---|
| 301 | Permanent | Yes, commonly |
| 302 | Temporary | Yes, commonly |
| 307 | Temporary | No |
| 308 | Permanent | No |
Use a 307 temporary redirect when the redirect is temporary and the original HTTP method must be preserved (e.g., a POST request must remain a POST request).
Use a 308 permanent redirect when the move is permanent and the request method must be preserved.
For ordinary webpages accessed through GET requests, 301 and 302 remain widely used and understood.
How to Implement a 301 or 302 Redirect
Server-side redirects are generally preferred because browsers and search engine crawlers receive the redirect directly in the HTTP response.
Apache Redirects with .htaccess
301 Redirect for One Page
Redirect 301 /old-page https://www.example.com/new-page
Using mod_rewrite:
RewriteEngine On
RewriteRule ^old-page/?$ /new-page [R=301,L]
302 Redirect for One Page
Redirect 302 /temporary-page https://www.example.com/temporary-destination
Using mod_rewrite:
RewriteEngine On
RewriteRule ^temporary-page/?$ /temporary-destination [R=302,L]
Redirect HTTP to HTTPS
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Nginx Redirects
301 Redirect
location = /old-page {
return 301 https://www.example.com/new-page;
}
302 Redirect
location = /temporary-page {
return 302 https://www.example.com/temporary-destination;
}
HTTP to HTTPS Redirect
server {
listen 80;
server_name example.com www.example.com;
return 301 https://www.example.com$request_uri;
}
After editing the configuration, validate it before reloading Nginx:
nginx -t
PHP Redirects
301 Redirect in PHP
<?php
header('Location: https://www.example.com/new-page', true, 301);
exit;
302 Redirect in PHP
<?php
header('Location: https://www.example.com/temporary-page', true, 302);
exit;
The header() call must be executed before output is sent to the browser. Always use exit after the redirect to prevent the remainder of the script from continuing to run.
Node.js and Express Redirects
301 Redirect
app.get('/old-page', (req, res) => {
res.redirect(301, '/new-page');
});
302 Redirect
app.get('/temporary-page', (req, res) => {
res.redirect(302, '/temporary-destination');
});
In many frameworks, 302 is the default redirect status when no status code is specified. Developers should explicitly define the desired code instead of relying on defaults.
WordPress Redirects
WordPress redirects can be configured through a redirect management plugin, hosting control-panel rules, server configuration, or SEO plugins that include redirect modules. For large sites, use a solution that supports bulk redirect imports, regex rules, redirect logging, 404 monitoring, status-code selection, loop detection, and export features.
How to Test a Redirect
A redirect should be tested at the HTTP level rather than only by opening the page in a browser.
Test with cURL
curl -I https://www.example.com/old-page
A correct 301 response should include:
HTTP/2 301
location: https://www.example.com/new-page
To follow the complete redirect chain:
curl -IL https://www.example.com/old-page
The final destination should normally return HTTP/2 200.
Use Browser Developer Tools
Open the browser’s developer tools and inspect the Network panel. Check the source URL, status code, Location header, number of redirect hops, final response code, whether an HTTP method changed, and whether a redirect loop occurred.
Use Google Search Console
The URL Inspection tool can help determine how Google views individual URLs. After a migration, monitor indexed old and new URLs, redirect errors, soft 404 reports, sitemap processing, and canonical URL selection.
Use an Online Redirect Checker
Online redirect tools can show HTTP status codes, redirect chains, destination URLs, HTTP-to-HTTPS behavior, and response headers. The nslookup.net Redirect Checker lets you trace the full redirect chain for any URL, showing each hop’s status code, location header, and final destination in a clear table.
For large websites, a crawler or custom script is more efficient than checking URLs individually.
Common Redirect Mistakes
1. Creating Redirect Chains
A redirect chain occurs when one URL redirects to another URL that redirects again. Instead of Page A → Page B → Page C → Page D, configure direct redirects: Page A → Page D, Page B → Page D, Page C → Page D. Google advises keeping chains low, ideally no more than three redirects.
2. Creating Redirect Loops
A loop occurs when redirects send the client in a circle (Page A → Page B → Page A). Users may see a “too many redirects” error. Common causes include conflicting server and CMS rules, incorrect HTTP-to-HTTPS configuration, reverse proxy settings, and CDN redirect rules.
3. Redirecting Every Removed Page to the Homepage
Redirecting removed pages to an unrelated homepage is not a reliable SEO strategy. Google may treat irrelevant redirects as soft 404 responses. Instead, redirect to a close replacement, redirect to a genuinely relevant consolidated page, return 404 when no replacement exists, or return 410 when content has intentionally been permanently removed.
4. Leaving Old URLs in Internal Links
Even when a redirect works, internal links should point directly to the final destination. Linking through redirects adds unnecessary requests, slows navigation, and creates avoidable crawler work. Update navigation menus, content links, breadcrumbs, image URLs, CSS files, JavaScript references, and structured data.
5. Keeping Old URLs in the XML Sitemap
A migration sitemap should contain the new canonical URLs, not URLs that redirect. Including redirected URLs sends conflicting signals to search engines.
6. Using Conflicting Canonical Tags
The destination page should generally contain a self-referencing canonical tag pointing to itself. Do not redirect an old URL to a new page while the new page’s canonical tag points back to the old URL.
7. Blocking the Redirected URL in robots.txt
Search engines may need to crawl the old URL to see the redirect. Blocking it in robots.txt can prevent the crawler from observing the redirect correctly.
8. Redirecting to a Non-Indexable Destination
A permanent redirect should not point to a page that is blocked by robots.txt, marked noindex, returning 404 or 500, or canonicalized to an unrelated URL. The destination should be accessible, useful, relevant, and technically stable.
How Long Should You Keep a 301 Redirect?
For site migrations, Google recommends keeping redirects in place for as long as possible and generally for at least one year. This gives Google time to recrawl old URLs and transfer associated signals to the new locations. From a user perspective, permanent redirects may be worth keeping indefinitely because old backlinks and bookmarks can remain active for many years.
Removing redirects too early can cause old backlinks to lead to 404 pages, bookmarked URLs to stop working, lost referral traffic, and previously consolidated signals to become less clear. At the same time, update important internal and external links so users do not have to pass through the redirect indefinitely.
Is a Canonical Tag the Same as a 301 Redirect?
No.
A 301 redirect sends users and search engines away from the old URL — the source page is no longer directly accessible.
A canonical tag allows the page to remain accessible while suggesting that another URL should be treated as the preferred version.
Use a 301 redirect when the old URL should no longer be used, users should always reach the new URL, and the move is permanent.
Use a canonical tag when multiple accessible pages contain identical or very similar content, users may still need to visit each URL, and redirecting is not appropriate.
Canonical tags are signals rather than absolute directives. They should not be used as a substitute for a permanent redirect during a genuine URL migration.
Frequently Asked Questions
Is a 301 or 302 redirect better for SEO?
Neither is universally better. The correct choice depends on intent. Use a 301 when the move is permanent. Use a 302 when the change is temporary and the original URL should remain the primary version.
Does a 301 redirect reduce rankings?
Google states that 301 and other permanent redirects do not cause a loss of PageRank. Rankings can still fluctuate temporarily during a migration while URLs are recrawled and reindexed.
How long can a 302 redirect remain active?
There is no universal number of days that automatically determines whether a redirect is temporary. Use a 302 as long as the original URL is expected to return as the main destination. When the move becomes permanent, change the redirect to 301 or 308.
Can Google treat a 302 as a 301?
Search engines may evaluate redirects alongside other canonicalization signals, especially when a supposedly temporary redirect remains active for a long period. However, website owners should clearly communicate their intent — use 301 for a permanent move and 302 for a temporary move.
Should I use 301 or 302 for an A/B test?
Use a 302 redirect for temporary A/B test variations. Google specifically recommends 302 rather than 301 for tests that redirect users to an alternative URL.
Should I use 301 or 302 for maintenance?
Use a 302 when the original page will return after maintenance. If the service has permanently moved to another URL, use a 301.
Should I redirect a deleted page?
Redirect it only when there is a relevant replacement. When no suitable replacement exists, return a proper 404 or 410 response rather than redirecting users to an unrelated page.
What is the difference between 301 and 308?
Both are permanent redirects. A 308 explicitly preserves the original HTTP method and request body, while browsers commonly change POST requests to GET when following a 301.
What is the difference between 302 and 307?
Both are temporary redirects. A 307 preserves the original method and request body, while a 302 may cause a POST request to become a GET request.
Can a redirect point to another domain?
Yes. A redirect can send users to another page on the same domain, a subdomain, or a completely different domain. For domain migrations, map each old URL to its closest equivalent on the new domain.
How can I check whether a redirect is 301 or 302?
Use curl -I https://www.example.com/old-page to see the HTTP status code in the response headers. You can also use browser developer tools, a website crawler, or the nslookup.net Redirect Checker which shows the full redirect chain including each status code.
Conclusion
The difference between a 301 and 302 redirect is simple but technically important:
- Use a 301 redirect when a URL has moved permanently.
- Use a 302 redirect when the change is temporary and the original URL will return.
A 301 is the correct choice for permanent URL changes, domain migrations, HTTP-to-HTTPS transitions, duplicate URL consolidation, and permanently merged content.
A 302 is appropriate for maintenance pages, temporary campaigns, A/B tests, short-term routing changes, and other situations where the original URL should remain the primary indexed address.
Redirects should always point to relevant destinations, avoid unnecessary chains, preserve consistent canonical signals, and be tested at the HTTP response level. For successful SEO migrations, redirect each old URL directly to its most relevant new equivalent, update internal links and sitemaps, monitor Google Search Console, and keep permanent redirects active for at least one year — and preferably longer when old links may still receive traffic.