TidyURLs
Go to Tools
BLOG
The TidyURLsJournal

Practical guides, tutorials, and insights about URLs, SEO, web development, and online marketing. Learn, troubleshoot, and get the most of the web.

Back to the Journal
TidyURLs Journal

HTTP Redirect.

Practical insights, clear explanations, and useful ideas for understanding the web.

October 18, 202611 min read5 topics
HTTP Redirect.
Explore the details

Advertisement

#HTTP#HTTPS#redirect#301#302
October 18, 202611 min read

301 vs. 302 Redirects: Differences, SEO, and When to Use Each

Imagine moving a page on your website to a new address. Visitors who follow an old link should still reach the right destination, and search engines need to understand what happened to the original URL.

That's where HTTP redirects come in.

Two of the most common redirect status codes are 301 Moved Permanently and 302 Found. They can both send visitors to a different URL, but they communicate different intentions to browsers, crawlers, and other HTTP clients.

Choosing the right one helps keep websites accessible, prevents unnecessary redirect chains, and makes migrations easier to manage.

In this guide, you'll learn how 301 and 302 redirects work, how they differ, what they mean for SEO, and how to troubleshoot common redirect problems.

A web analytics dashboard on a computer screen

What is an HTTP redirect?

An HTTP redirect is a response that tells a client to request a different URL.

For example, suppose a website changes an article's address from:

https://example.com/old-guide

to:

https://example.com/new-guide

When a visitor requests the old URL, the server can return a redirect response with a Location header pointing to the new address.

A simplified HTTP response might look like this:

HTTP/1.1 301 Moved Permanently
Location: https://example.com/new-guide

A browser that follows the redirect requests the new URL and displays the destination page.

Redirects are useful for:

  • Moving pages to new addresses.
  • Redirecting HTTP URLs to HTTPS.
  • Consolidating duplicate URL versions.
  • Retiring outdated pages.
  • Changing domain names.
  • Sending visitors to temporary destinations.

The exact behavior depends on the redirect status code, the client, and the response headers.

For the underlying HTTP specifications, see RFC 9110: HTTP Semantics.

What is a 301 redirect?

A 301 Moved Permanently response indicates that a resource has moved to a new location permanently.

For example:

https://example.com/old-product

redirects to:

https://example.com/products/new-product

A 301 is appropriate when the original address is no longer the preferred location and the change is intended to persist.

When should you use a 301?

Typical examples include:

  • Moving a page to a new permanent URL.
  • Changing your website's domain.
  • Consolidating duplicate pages into a preferred version.
  • Replacing an old product URL with a permanent successor.
  • Redirecting an old URL structure after a website redesign.

A permanent redirect helps browsers and search engines understand that the destination is intended to replace the old location.

However, a 301 is not a guarantee that a search engine will immediately update its index. Search engines still need to crawl and process the redirect.

Can a 301 be cached?

Yes. Permanent redirects can be cached, depending on the browser, intermediary caches, and caching headers.

This matters during testing. If you accidentally configure a 301 and then change it to a 302, your browser may continue following a cached redirect.

When debugging redirects, test with browser caching in mind and inspect the actual HTTP response.

What is a 302 redirect?

A 302 Found response indicates that a resource is temporarily available at a different location.

For example, a website might temporarily redirect:

https://example.com/event

to:

https://example.com/event-preview

while the main page is being updated.

The original URL remains the intended long-term address.

When should you use a 302?

Common examples include:

  • Temporarily redirecting visitors during maintenance.
  • Sending visitors to a temporary campaign landing page.
  • Running a short-lived website experiment.
  • Redirecting a request while the original resource remains the preferred destination.

The important factor is not simply how long the redirect lasts. It is whether the original URL is expected to remain the canonical destination.

A redirect lasting several weeks may still be temporary. A redirect intended to replace the original URL permanently should generally use a permanent redirect instead.

Is 302 the only temporary redirect?

No. HTTP also defines other redirect status codes, including 303 See Other, 307 Temporary Redirect, and 308 Permanent Redirect.

The 307 and 308 status codes preserve the request method when redirecting. This can be important for requests that use methods other than GET.

A 303 redirect, by contrast, directs the client to retrieve another resource, typically using GET.

For an overview of HTTP status codes, see MDN's HTTP response status documentation.

301 vs. 302: What's the difference?

The primary difference is the intended permanence of the change.

Feature301302
MeaningPermanent redirectTemporary redirect
Intended destinationNew permanent locationTemporary location
Typical useURL migrationTemporary campaign or maintenance
Search engine interpretationSignals a permanent moveSignals a temporary move
Browser cachingMay be cachedMay be cached depending on headers and implementation
Suitable for permanent domain changesUsuallyGenerally not the preferred choice

Both responses can direct visitors to a different URL. Neither automatically guarantees that every client, cache, or search engine will behave identically.

A person working on a laptop with a website analytics dashboard

How do 301 and 302 redirects affect SEO?

Redirects are an important part of technical SEO because they help search engines discover where content has moved.

Permanent redirects and search engines

When Google processes a permanent redirect, it treats the destination as a strong canonicalization signal.

In practical terms, if an old page has genuinely moved to a new URL, a 301 can help search engines consolidate signals toward the new destination.

For a website migration, it is important to:

  1. Map old URLs to their most relevant new destinations.
  2. Implement permanent redirects for pages that have moved permanently.
  3. Update internal links to point directly to the new URLs.
  4. Update canonical tags and XML sitemaps.
  5. Monitor crawl errors and redirect behavior after launch.

A redirect alone doesn't guarantee rankings, traffic, or indexing. The destination should still be relevant, accessible, and useful.

Temporary redirects and search engines

A 302 indicates that the original resource is expected to remain the primary location.

Search engines can still index and evaluate redirected destinations, and their behavior depends on the signals they observe over time. Avoid relying on status codes alone to control indexing.

If a move is genuinely permanent, use a permanent redirect rather than keeping a temporary status indefinitely.

Do redirects destroy link equity?

A well-implemented redirect to a relevant replacement page can help preserve signals associated with the old URL. But redirects aren't a way to transfer value to any arbitrary destination.

Redirecting hundreds of unrelated pages to a homepage, for example, may be confusing for users and search engines. When a page has no equivalent replacement, consider whether returning a 404 Not Found or 410 Gone response is more appropriate.

Google's official guidance is available in its documentation on site moves with URL changes.

What is a redirect chain?

A redirect chain occurs when one URL redirects to another URL that redirects again before reaching the final destination.

For example:

/old-page
   ↓ 301
/intermediate-page
   ↓ 302
/new-page
   ↓ 200
Final content

In this example, a visitor must pass through three requests to reach the final page.

Redirect chains can appear after repeated redesigns, domain migrations, changes to URL conventions, or poorly coordinated redirects.

Advertisement

Why are redirect chains a problem?

They can:

  • Add unnecessary network requests and latency.
  • Make debugging more difficult.
  • Complicate crawling and redirect management.
  • Increase the chance of a broken intermediate redirect.
  • Make it harder to understand where a URL ultimately leads.

The solution is usually to update the original redirect so that it points directly to the final destination.

Instead of:

/old-page → /intermediate-page → /new-page

prefer:

/old-page → /new-page

Keep the intermediate URL working if other links still depend on it, but remove unnecessary hops from the redirect path.

What is a redirect loop?

A redirect loop happens when URLs redirect back to one another indefinitely.

For example:

/page-a → /page-b
/page-b → /page-a

The browser repeatedly follows redirects until it stops and displays an error.

Redirect loops can result from conflicting server rules, incorrect HTTPS configuration, reverse-proxy settings, or a combination of application and hosting redirects.

How can you diagnose a redirect loop?

Check the complete redirect sequence, including:

  • The requested URL and each Location header.
  • Whether HTTP and HTTPS redirect rules conflict.
  • Whether the server and reverse proxy agree on the original request scheme.
  • Whether trailing-slash or www/non-www rules conflict.
  • Whether a CDN or caching layer is applying an unexpected redirect.

Avoid fixing the issue by adding another redirect rule without understanding the existing chain.

How to check a redirect

You can inspect redirects using browser developer tools or command-line utilities.

Using curl

To inspect the first response without following redirects:

curl -sS -D - -o /dev/null \
  https://example.com/old-page

Look for the HTTP status and the Location header.

To follow redirects and display the final response details:

curl -sS -L -D - -o /dev/null \
  https://example.com/old-page

The -L option tells curl to follow redirects. The headers can reveal intermediate responses and the final response.

Be aware that a command-line request may behave differently from a browser request because of cookies, authentication, user-agent differences, or application logic.

Using browser developer tools

  1. Open the browser's developer tools.
  2. Select the Network tab.
  3. Navigate to the URL.
  4. Select the relevant document request.
  5. Inspect the status code and response headers.
  6. Follow the requests to identify intermediate redirects.

This approach is useful when redirects behave differently in a browser than they do from the command line.

Using a redirect checker

A redirect checker automates the process of following a URL and displaying its redirect sequence.

It can help you identify the status code at each hop, find the final destination, and detect chains or loops.

You can try the TidyURLs Redirect Checker to investigate a URL without manually examining each response.

Common redirect mistakes

Using a temporary redirect for a permanent migration

If a page has moved permanently, a 301 or another appropriate permanent redirect is generally a better choice than a 302.

Redirecting everything to the homepage

A homepage isn't automatically a suitable replacement for every deleted page. Redirect to a relevant successor when one exists.

Keeping unnecessary redirect chains

Update old redirect rules to point directly to the final destination where possible.

Forgetting internal links

After moving a page, update your website's internal links, navigation, canonical tags, and sitemap instead of relying indefinitely on redirects.

Creating conflicting HTTPS rules

Your application, hosting provider, proxy, and CDN may all have redirect behavior. Make sure they agree on the intended canonical URL.

Testing only the final destination

A final page returning 200 OK doesn't mean the redirect path is correct. Inspect the intermediate responses to find unnecessary hops, unexpected status codes, or loops.

A practical redirect migration checklist

Before launching a URL migration, review the following:

  • Create a mapping from each old URL to its relevant new destination.
  • Use permanent redirects for genuinely permanent moves.
  • Test representative URLs from every old URL pattern.
  • Check for redirect chains and loops.
  • Update internal links and canonical tags.
  • Update the XML sitemap to include preferred URLs.
  • Verify that important destination pages return successful responses.
  • Monitor crawl errors and search performance after launch.

A migration is easier to troubleshoot when the old-to-new URL mapping is documented and the redirect rules are tested before deployment.

Frequently asked questions

Does a 301 redirect pass SEO value?

A 301 is a strong signal that a URL has moved permanently, and search engines can consolidate signals toward the destination. It does not guarantee specific rankings or traffic outcomes.

Can I change a 302 to a 301 later?

Yes. If a temporary move becomes permanent, update the redirect accordingly. Remember that caches may retain earlier responses, so test with caching in mind.

Does a 301 redirect change the URL in the browser?

Typically, yes. When a browser follows the redirect, the address bar shows the destination URL.

Is a 302 redirect bad for SEO?

No. A 302 is appropriate when the move is temporary. The problem is using a temporary redirect when the intended move is permanent, or implementing redirects in a way that confuses users and crawlers.

How many redirects are too many?

There is no universal number that makes every redirect chain invalid, but unnecessary hops add latency and complexity. Aim for direct redirects to the final destination whenever practical.

Should I use 301 or 308?

Both indicate a permanent move, but 308 preserves the request method. For ordinary website page moves, 301 is common. For applications handling methods such as POST, method preservation may be important, so select the status code based on the application's behavior.

Final thoughts

301 and 302 redirects solve similar problems, but they communicate different intentions.

Use a 301 when a URL has moved permanently and a 302 when the move is temporary. Beyond choosing the correct status code, keep redirect paths short, avoid loops, update internal links, and verify the final destination.

Redirect management is a small part of website maintenance that can have a meaningful effect on user experience and technical SEO.

Need to inspect a URL? Try the TidyURLs tools:

Further reading