HTTP 301 vs 302 redirects

Use a 301 when a URL has moved permanently and a 302 when it should point somewhere else temporarily. Follow the examples below to verify what your server actually returns.

301 · A permanent move

You moved a page from /old to /new. A request to /old should return 301 with /new in the Location header. In this example, /new serves the page with 200.

/old → 301 → /new → 200

302 · A temporary redirect

During maintenance, /shop sends visitors to /maintenance with a 302. The maintenance page returns 200. When the shop reopens, /shop should return 200 directly.

/shop → 302 → /maintenance → 200

How to verify the redirect

Enter the original URL in Redirect Checker. Read the first status code and the destination of each hop. Check that the last URL is the page you intended and that it responds successfully. If the same URL repeats, look for a redirect loop.

A client may turn POST into GET after a 301 or 302. If the method must be preserved, use 308 for a permanent redirect or 307 for a temporary one.

Check a URL in Redirect Checker

RFC 9110 §15.4.2–15.4.3