Skip to content
Nazmul Nikhil
Menu

302 Redirect (Ahrefs): When to Change It to a 301

Ahrefs flags temporary 302 redirects. If the move is permanent, a 301 sends a clearer signal to Google. Here's how to decide and how to switch.

Nazmul Nikhil

By

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

Published 2 min read
302 Redirect (Ahrefs): When to Change It to a 301
Photo: Drew Easley on Unsplash

In short

Ahrefs flags "302 redirect" for internal URLs that use a temporary redirect. Google treats permanent redirects (301 or 308) as a strong signal that the new URL should be shown in results, and temporary ones as a weak signal. If the move is permanent, change the 302 to a 301. If it's truly temporary, such as a short promotion or maintenance, keep it.

A 302 says "this page is somewhere else for now." Many 302s on real sites are permanent moves set up with the wrong code.

Decide: temporary or permanent?

Situation Use
Page moved for good, site migration, merged content 301
Seasonal or short promotion, then the original returns 302
Redirect based on login, language choice or device 302 (and keep it consistent)
Out-of-stock product sent to a category for a few days 302

If a 302 has been in place for months with no plan to undo it, it's a permanent move.

Where 302s come from

  • Redirect plugins or tools where 302 was the default choice

  • PHP code using header('Location: ...'), which sends 302 unless told otherwise

  • Express apps using res.redirect(url), which also defaults to 302

  • Language or geo redirects on the home page

How to switch to 301

WordPress: in Rank Math's Redirections, Yoast Premium or the Redirection plugin, edit the rule and choose 301.

Shopify: URL redirects created in Content > Menus > URL redirects are permanent. 302s on Shopify usually come from apps or Markets geo redirects.

Webflow: redirects in Site settings > Publishing > 301 redirects are permanent.

Wix: URL Redirect Manager rules are 301 by default.

Custom builds: set the code explicitly:

// Express
res.redirect(301, '/new-url/');
// PHP
header('Location: https://example.com/new-url/', true, 301);

Common mistakes

  • Redirecting the home page by language with a 302 and never letting crawlers see the root URL. Use hreflang and a language selector instead of forced redirects where you can.

This guide isn't affiliated with or endorsed by Ahrefs.

Sources and references

TAGSAhrefs Site Audit302 redirect301 vs 302 redirectTemporary redirect seo
Nazmul Nikhil

About the author

Nazmul Nikhil

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

SEO and AI search consultant in Dhaka, Bangladesh, helping small and mid-size businesses in the USA, UK, Australia and Canada.

Need help with this?

Get it fixed with Technical SEO

I find the issues that cost you traffic and fix them, starting with the pages that matter most.

Keep reading

Related articles

All Site Audit Issues posts →

Get the next guide in your inbox

One email when a new SEO or AI search guide goes live.

Ready to grow?

Get a free audit of your website, or book a 30-minute call to talk through your goals.

Nazmul Hasan

Talk to Nazmul directly

Reply within 24h

WhatsApp +880 1682835118
nazmulnikhil@gmail.com