HTTP

HTTP 301 Moved Permanently vs 302 Found

Both 301 and 302 are redirect status codes, but they differ in permanence. A 301 tells clients and search engines that the resource has moved permanently, while a 302 indicates a temporary redirect that should not update bookmarks or cached URLs.

Description

The resource has been permanently moved to a new URL. All future requests should use the new URL. Search engines will transfer link equity to the new URL.

When You See It

After domain migrations, URL restructuring, or when consolidating duplicate URLs.

How to Fix

Update links and bookmarks to the new URL in the Location header. For SEO, this is the preferred redirect for permanent moves.

Description

The resource temporarily resides at a different URL. The client should continue using the original URL for future requests.

When You See It

During A/B testing, temporary maintenance pages, or geo-based redirects.

How to Fix

Follow the Location header. Note: browsers may change POST to GET on redirect.

Key Differences

1.

301 is permanent — browsers cache the redirect and search engines transfer link equity to the new URL.

2.

302 is temporary — browsers do not cache the redirect and search engines keep indexing the original URL.

3.

301 may cause some older clients to change POST requests to GET (method rewriting), while 302 has the same ambiguity.

4.

Use 301 for domain migrations, URL restructuring, or when the old URL will never return.

5.

Use 302 for A/B tests, maintenance pages, or geo-based routing where the original URL remains valid.

When to Use Which

Use 301 when a resource has permanently moved and you want search engines to index the new location. Use 302 when the redirect is temporary and the original URL should retain its search ranking. If you need to preserve the HTTP method (POST stays POST), consider 307/308 instead.

Learn More