Use a 301 when a page has moved for good: old URL gone, new URL is the real one from now on. Use a 302 when the move is temporary: you want visitors sent to a different page right now, but the original URL stays the "real" one and should keep ranking. Getting this backwards is a common redirect mistake, and it can cost you search rankings if search engines cache the wrong signal.
The difference that matters
Both status codes send a browser (and a search crawler) from one URL to another. The difference is what they tell search engines to do with the old URL:
- 301 Moved Permanently: transfers ranking signals to the new URL. Search engines drop the old URL from their index over time and treat the new one as canonical. Use this for domain migrations, permanent URL restructuring, or retiring a page in favor of a replacement.
- 302 Found (temporary redirect): tells search engines to keep the original URL indexed and keep crawling it. The new URL is treated as a short-term detour, not a replacement. Use this for A/B tests, maintenance pages, geo-based routing, or anything you plan to undo.
If you use a 302 for something that's permanent, search engines may keep indexing the old URL indefinitely and never fully credit the new one. If you use a 301 for something temporary, you can end up with the wrong page ranking after you switch back, because search engines already reassigned the signal.
How to check which one a redirect is using
Run:
curl -I https://example.com/old-page
Look at the first line of the response. You'll see either HTTP/1.1 301 Moved Permanently or HTTP/1.1 302 Found. If you're chasing a redirect chain (redirect to a redirect to a redirect), add -L to follow it, or drop -L and repeat the command against each new Location header to see every hop. Long chains slow down page loads and can dilute the SEO benefit of a 301, so collapse multi-hop chains down to a single redirect straight to the final URL where you can.
Where to set these up
On most hosting accounts, the common paths are:
- WordPress: a redirect plugin, or an
.htaccessrule in the site's document root. cPanel's File Manager can edit.htaccessdirectly, or use the Redirects tool under Domains in cPanel for simple one-to-one redirects without touching a file. - Whole domain moved to a different URL structure: this is almost always a job for
.htaccessrewrite rules, since you're usually redirecting a pattern of URLs, not just one page. - Bare domain to www (or the reverse): also typically an
.htaccessrule, and it should always be a 301, since that relationship isn't temporary.
Most redirect tools, including cPanel's Redirects tool and most WordPress plugins, default to a 301. Check the settings before publishing if you need a 302, since defaulting to permanent when you meant temporary is an easy mistake to make.
A quick rule of thumb
Ask: "If someone visits this exact URL again in six months, should it still redirect?" If yes, it's a 301. If the answer is "probably not, this is short-term," it's a 302. When genuinely unsure, use a 302 first. It's reversible without any lasting SEO impact. You can always upgrade it to a 301 once you're sure the move is permanent, but downgrading a 301 back to a temporary state is much messier since search engines have already started transferring authority to the new URL.
If something looks wrong
If a redirect isn't behaving the way you expect, isn't firing at all, or you're seeing a redirect loop, open a ticket from your portal's Support section. It goes to a real person, and they can check server-level rewrite rules and cache state that aren't visible from the outside.