How to Tell If a Redirect Is Permanent or Temporary
Learn to distinguish between 301 permanent redirects and 302 temporary redirects — what they mean, when they're used, and why the difference matters for SEO and user experience.

When you visit a URL and end up somewhere else, you've been redirected. But not all redirects are created equal — some are permanent moves, others are temporary detours. Understanding the difference helps you interpret web behavior, troubleshoot issues, and make smarter decisions if you manage websites.
This guide explains how to tell if a redirect is permanent or temporary, focusing on the two most common types: 301 and 302. No exploit techniques — just literacy.
What Is a Redirect?
A redirect happens when a server tells your browser: "The content you requested isn't here — go to this other URL instead."
Your browser automatically follows the redirect and loads the new location. You see the final page, but behind the scenes, HTTP status codes tell the story.
Redirects are used for:
The key question: is this move permanent or temporary?
Related: HTTP Status Codes Decoded — understand the numbers that power the web.
The Two Main Types: 301 vs 302
301 Moved Permanently
What it means:
The resource has permanently moved to a new URL. The server is saying: "This content used to live here, but it's now at this new address — forever. Update your bookmarks."
When it's used:
What browsers and search engines do:
Example:
You rebrand your company from ExampleCorp to BetterCorp. You set up a 301 redirect from examplecorp.com to bettercorp.com. Search engines recognize the permanent move and credit your new domain with the old domain's authority.
Learn more: How to Read an HTTP Status Code Without Panic
302 Found (Temporary Redirect)
What it means:
The resource is temporarily at a different URL. The server is saying: "Go here for now, but the original URL is still valid and might change back later."
When it's used:
What browsers and search engines do:
Example:
You're running a holiday sale. You temporarily redirect your homepage to /holiday-sale. After the sale, you remove the redirect. Since it was a 302, search engines still rank your homepage normally — they knew it was temporary.
How to Check: Developer Tools
You don't always see status codes directly in the browser. Here's how to inspect them.
Using Browser DevTools (Chrome, Edge, Firefox)
What you'll see:
Tip: Redirects often chain. You might see multiple 3xx responses before the final 200 OK. Follow the chain to see the full journey.
Using curl (Command Line)
If you prefer the terminal:
curl -I https://example.com
The -I flag fetches only headers. Look for the status line:
HTTP/1.1 301 Moved Permanently
Location: https://newexample.com
The Location header tells you where the redirect points.
Want to follow redirects automatically?
curl -L -I https://example.com
The -L flag follows redirects and shows the final destination.
Related: The Journey of a URL — see what happens when you press Enter in your browser.
301 vs 302: Quick Comparison
| Feature | 301 Permanent | 302 Temporary |
|---------|-------------------|-------------------|
| Intent | Content has moved forever | Content is temporarily elsewhere |
| SEO impact | Search engines transfer ranking to new URL | Original URL keeps its ranking |
| Browser caching | Often cached (future visits skip old URL) | Not cached permanently |
| When to use | Domain changes, permanent URL restructures | A/B tests, maintenance, login flows |
| Update bookmarks? | Yes — the old URL is obsolete | No — the original URL still works |
Modern Alternatives: 307 and 308
307 Temporary Redirect and 308 Permanent Redirect are newer alternatives to 302 and 301.
What's different:
The older 301 and 302 codes allowed browsers to change a POST request to a GET request when following the redirect. This was sometimes unintended behavior.
307 and 308 preserve the original request method:
When to use them:
Use 307 and 308 when you need strict control over HTTP methods. For most simple redirects (like moving pages), 301 and 302 work fine.
Why the Difference Matters
For Website Owners
Choosing the wrong redirect can hurt SEO:
Example mistake:
You temporarily redirect /product-a to /product-b during a stockout, but you accidentally use 301. Search engines interpret this as a permanent move and start transferring ranking. When product A is back in stock and you remove the redirect, you've lost SEO value.
For Users
As a user, understanding redirects helps you:
For Developers
Debugging redirects is easier when you understand the intent:
Related reading: What DNS Does — understand how domain names resolve before redirects even happen.
Other Redirect Codes (Less Common)
303 See Other:
Used after a POST request to redirect the user to a GET request (e.g., after submitting a form, redirect to a success page).
304 Not Modified:
Technically a redirect, but special. It tells the browser: "The resource hasn't changed since you last fetched it — use your cached version."
300 Multiple Choices:
Rare. The server offers multiple options, and the user (or client) chooses. Rarely used in modern web.
For most use cases, you'll only encounter 301, 302, 307, and 308.
How to Set Redirects (For Website Owners)
On Apache (.htaccess)
301 Permanent:
Redirect 301 /old-page https://example.com/new-page
302 Temporary:
Redirect 302 /old-page https://example.com/new-page
On Nginx
301 Permanent:
location /old-page {
return 301 https://example.com/new-page;
}
302 Temporary:
location /old-page {
return 302 https://example.com/new-page;
}
In Node.js (Express)
301 Permanent:
app.get('/old-page', (req, res) => {
res.redirect(301, '/new-page');
});
302 Temporary:
app.get('/old-page', (req, res) => {
res.redirect(302, '/new-page');
// or just: res.redirect('/new-page'); (302 is default)
});
Common Redirect Patterns
Pattern 1: HTTP to HTTPS
Use 301 permanent:
http://example.com → https://example.com
This is a one-way, permanent upgrade. You never intend to go back to HTTP.
Pattern 2: www to non-www (or vice versa)
Use 301 permanent:
https://www.example.com → https://example.com
Pick one canonical version and redirect the other permanently. This consolidates SEO value.
Pattern 3: Maintenance Mode
Use 302 temporary:
https://example.com → https://example.com/maintenance
You're temporarily down for maintenance. Once maintenance is done, you remove the redirect. The original URL should retain its SEO value.
Pattern 4: Login Required
Use 302 temporary:
https://example.com/dashboard → https://example.com/login
After login, users return to /dashboard. The redirect is temporary and conditional.
The Takeaway
301 = Permanent. The content has moved forever. Update bookmarks, search engines transfer SEO value.
302 = Temporary. The content is temporarily elsewhere. Original URL remains valid, search engines keep it indexed.
How to check: Use browser DevTools (Network tab) or curl -I to see the status code.
Why it matters: Choosing the wrong redirect can hurt SEO, confuse users, and cause caching issues. Match the code to your intent.
Next time you see a redirect in the wild, you'll know whether it's saying "goodbye forever" or "be right back."
Related Reading:
*This post is part of Hacking Bits, where we explain how everyday technology works — one bit at a time.*
Related Posts
How to Read an HTTP Status Code Without Panic
A plain-language guide to understanding 2xx, 3xx, 4xx, and 5xx status codes — what they mean, when you see them, and what to do about them.
Checklist: Do You Actually Need a CDN?
A practical checklist to understand what CDNs do, what they cache, when they help, and whether your site needs one.
Git Branch vs Commit: What's the Difference?
Branches and commits are both fundamental to git — but they work in completely different ways. Here's what each one does and why it matters.