Get a free website with any plan

See how
INTERNET ESSENTIALS

301 vs 302 redirects

Last updated

IN SHORT

A 301 redirect signals a permanent move, transferring search ranking authority to the new URL. A 302 redirect signals a temporary detour, keeping the original URL indexed. For Flashcloud hosting accounts, use a 301 for site migrations or domain changes, and choose a 302 for maintenance pages or tests you plan to undo.

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 .htaccess rule in the site's document root. cPanel's File Manager can edit .htaccess directly, 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 .htaccess rewrite rules, since you're usually redirecting a pattern of URLs, not just one page.
  • Bare domain to www (or the reverse): also typically an .htaccess rule, 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.

Common questions

Which redirect should I use if I am not sure?

Use a 302 redirect first. It is temporary and reversible without lasting SEO impact. You can always change it to a 301 once the move is permanent.

How do I check if my URL is using a 301 or 302?

Run curl -I followed by your page URL in a terminal. The very first line of the server response shows whether it returns a 301 or 302 status code.

Which redirect do I use to point my bare domain to www?

Use a 301 redirect. This URL relationship is permanent and typically runs through an .htaccess rewrite rule on your server.

Where do I set up redirects on my hosting account?

Set them up in cPanel using the Redirects tool under Domains, or add rules directly to your .htaccess file. WordPress sites can also use a redirect plugin.

CAN'T FIND IT?

Real humans answer fast.

Hosting with us? Open a ticket and a real person replies - no scripts, no upsells. Still choosing a host? The same team is included with every plan, from day one.