Skip to content
HTTP 302 Found — What It Means & How to Debug

HTTP 302 Found — What It Means & How to Debug

DodaTech Updated Jun 20, 2025 4 min read

HTTP 302 Found (temporary redirect) tells the client the resource is temporarily available at a different URL — browsers redirect but keep the original URL for future requests.

What It Means

The HTTP 302 Found status code is a temporary redirect response. It tells the client that the requested resource resides temporarily at a different URL provided in the Location header. Unlike the 301 Moved Permanently, a 302 redirect does not indicate permanence — clients should continue using the original URL for future requests.

Browsers and HTTP clients automatically follow the redirect, but they keep the original URL as the canonical location. Search engines do not transfer PageRank or indexing signals through 302 redirects — they treat the original URL as the authoritative one.

When It’s Sent

  • Temporary maintenance pages — redirecting users to a downtime notice
  • A/B testing — sending a percentage of traffic to a different variant
  • Login redirects — sending users to the login page and back after authentication
  • Geolocation-based routing — redirecting to a regional subdomain temporarily
  • Session-based pages — redirecting to a dynamically generated temporary URL

Real Example

curl -v http://example.com/maintenance

Expected response:

> GET /maintenance HTTP/1.1
> Host: example.com
>
< HTTP/1.1 302 Found
< Location: https://example.com/temporary-down.html
< Content-Length: 0
<

The browser follows the redirect to /temporary-down.html but remembers that /maintenance is the original URL to use in the future when the temporary page is removed.

How to Debug

Browser DevTools

  1. Open the Network tab and enable Preserve log
  2. Navigate to the URL
  3. Look for status 302 Found in the request list
  4. Check the Location header to see where it redirects
  5. A subsequent request to the new URL appears automatically

curl

curl -I http://example.com/temp-page

The Location header shows the redirect target. Use -L to follow the redirect:

curl -L http://example.com/temp-page -o /dev/null -w "Final status: %{http_code}"

Postman

Turn off Automatically follow redirects in Settings to capture the 302 and inspect the Location header. Turn it on to see the final response.

How to Fix

If you encounter an unexpected 302 redirect:

  • Server-side (Nginx): Look for return 302 or rewrite directives — check if maintenance mode is enabled
  • Server-side (Express): Search for res.redirect(302, ...) — often used in authentication middleware
  • A/B testing tools: Check if an A/B testing platform or feature flag is routing traffic to a variant
  • Session middleware: Verify the user has a valid session — many apps redirect unauthenticated users with a 302
  • Geolocation rules: Check CDN or server config for location-based redirect rules

Common Causes

ScenarioWhat HappensWhy It Matters
Maintenance modeAll requests get 302 to a maintenance pageUsers see a downtime notice instead of the app
Login requiredUnauthenticated users get 302 to /loginProtects private resources
A/B test variant50% of traffic gets 302 to variant BTests different page versions
Language redirectUser gets 302 to localized URL based on browser languageShows content in the user’s preferred language
Payment redirectAfter checkout, user gets 302 to payment gatewayCompletes the purchase flow

FAQ

What is the difference between 302 and 307 redirect?
Both are temporary redirects, but 307 Temporary Redirect guarantees that the HTTP method and body are preserved. A 302 may change POST to GET when followed by most browsers. Use 307 when you need to ensure the request method stays the same through the redirect.
Does a 302 redirect affect SEO?
Yes, but differently from a 301. Search engines treat a 302 as a temporary redirect and do not transfer ranking signals to the target URL. The original URL continues to be indexed. If the redirect becomes permanent, update it to a 301 to preserve SEO equity.
Why am I stuck in a 302 redirect loop?
A redirect loop happens when two or more redirects point to each other (A → B → A). This often occurs when authentication middleware and URL rewrite rules conflict. Check your server logs and use curl -I to trace the redirect chain until you see the same URL twice. Fix the middleware or rewrite rule that creates the cycle.

Related Codes

  • HTTP 301 Moved Permanently — permanent redirect, transfers SEO
  • HTTP 307 Temporary Redirect — temporary redirect, preserves HTTP method
  • HTTP 308 Permanent Redirect — permanent redirect, preserves HTTP method
  • HTTP 404 Not Found — what the target should return if the redirect points to a missing page

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro