How to Fix 302 Redirects Used for Permanent Moves

A 302 or 307 tells browsers and search engines that a URL has moved only for now and that the old address should be kept. When the move is actually permanent, such as HTTP to HTTPS, a domain change, a renamed page or trailing-slash cleanup, that signal is wrong. By the end of this guide you will have found every temporary redirect in your redirect chains, changed the permanent ones to 301 or 308, and confirmed the new status codes.

By Updated ⏱ 30 minutes🎯 Beginner● Medium impactTechnical
Illustration: 302 used for permanent moves fix guide
TECHNICAL · FIX GUIDE 302 used for permanent moves IMPACTEFFORT TIME30 minutes LEVELBeginner

Why it matters

With a temporary redirect, Google may keep indexing the old URL and treat it as canonical. Consolidating links and ranking signals onto the new URL then takes longer. Google eventually treats a long-standing 302 like a permanent one, but there is no fixed timeline, and in the meantime search results and AI answers can show outdated URLs.

Browsers and CDNs also don't cache 302 or 307 responses the way they cache 301 or 308. Every visit to the old URL then costs an extra round trip, which adds latency on mobile.

✕Beforehttp://example.com/pricing → 302 Found→ https://example.com/pricing(permanent HTTPS move flagged as✓Afterhttp://example.com/pricing → 301 MovedPermanently →https://example.com/pricing

What you need

A list of flagged URLs from your audit or a crawler such as Screaming Frog
Access to wherever redirects are defined: server config, CMS redirect plugin, CDN rules or application code
A terminal with curl, or a browser DevTools Network panel
Permission to purge your CDN or page cache

Step-by-step fix

1

List every redirect that returns 302 or 307

The check flags any page whose redirect chain contains a 302 or 307 at any hop, not just the first one. Trace each flagged URL and note every status code along the way. In Screaming Frog, go to Reports > Redirects > All Redirects, which exports full chains with the status code at each step.

text
curl -sIL http://example.com/pricing | grep -iE '^(HTTP|location)'
Pro tip: Test all four entry variants: http and https, with and without www. The 302 is often hiding on only one of them.
2

Separate truly temporary redirects from permanent ones

Keep 302 or 307 only when the original URL will come back. Legitimate temporary cases include:

  • login or cart gating (for example, /account → /login)
  • maintenance pages
  • short-lived A/B tests or seasonal promos
  • geo or language selection that depends on the visitor

Switch everything else to permanent. That covers HTTP→HTTPS, www/non-www, trailing slashes, renamed slugs, merged pages and domain migrations.

Pro tip: Use 301 for normal GET page moves. Use 308 when the request method and body must be preserved, such as API or form POST endpoints.
3

Find where each redirect is generated

The same redirect can come from several layers, so check the response headers for clues. A server: cloudflare header with no origin hit points to a CDN rule. An x-redirect-by: WordPress or x-redirect-by: redirection header points to WordPress or a plugin.

htaccess`, the Nginx config, then application code. Fix the redirect at the layer that actually issues it.

text
curl -sI http://example.com/pricing | grep -iE 'server|x-redirect-by|location|cf-'
4

Change server rules to 301

In Apache, a bare [R] flag defaults to 302, so always write R=301. The Redirect directive also defaults to 302 if you don't give it a status. In Nginx, return 302 and `rewrite ...

redirect are temporary. Use return 301 or rewrite ... permanent` instead.

Reload the server after editing.

apache
# Apache (.htaccess)
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://example.com%{REQUEST_URI} [R=301,L]
Redirect 301 /old-pricing /pricing

# Nginx
server {
  listen 80;
  server_name example.com www.example.com;
  return 301 https://example.com$request_uri;
}
rewrite ^/old-pricing$ /pricing permanent;
Pro tip: Run `nginx -t` or `apachectl configtest` before reloading so a typo doesn't take the site down.
5

Fix redirects issued by application code

Many frameworks default to temporary redirects:

  • PHP header('Location: ...') sends 302 unless you pass a status code.
  • Express res.redirect(url) sends 302.
  • WordPress wp_redirect() and wp_safe_redirect() default to 302.
  • Next.js middleware NextResponse.redirect() defaults to 307.

Pass the permanent status explicitly.

php
// PHP
header('Location: https://example.com/pricing', true, 301); exit;

// WordPress
wp_safe_redirect( home_url('/pricing/'), 301 ); exit;

// Express
res.redirect(301, '/pricing');

// Next.js middleware
return NextResponse.redirect(new URL('/pricing', req.url), 308);
6

Collapse chains and update internal links

Point each old URL straight to its final destination in one hop. com/new, rather than going through HTTPS first and then the slug change. Then update internal links, canonical tags, hreflang and XML sitemap entries to the final URL.

That way crawlers rarely hit redirects at all.

Pro tip: Screaming Frog's **Bulk Export > Response Codes > Internal > Redirection (3xx) Inlinks** shows exactly which pages still link to redirecting URLs.
7

Purge caches and verify the new status codes

Purge your CDN and any page-cache plugin, because a cached 302 can keep being served after you fix the origin. Re-run curl on every flagged URL and its http/www variants. Every hop should now show 301 or 308, except the ones you deliberately kept temporary.

Finally, re-run the audit.

text
for u in http://example.com/pricing http://www.example.com/pricing https://www.example.com/pricing; do echo "== $u"; curl -sIL "$u" | grep -iE '^HTTP|^location'; done
Pro tip: Test in a private window or with curl. Browsers cache 301s aggressively, so the browser bar is unreliable while you're iterating.

Platform-specific notes

WordPress

In the Redirection plugin, go to **Tools > Redirection**, edit the rule and set **HTTP code** to 301. In Rank Math, use **Rank Math SEO > Redirections**. In Yoast Premium, use **Yoast SEO > Redirects**. For HTTP→HTTPS, make sure both WordPress Address and Site Address under **Settings > General** use https, and handle the redirect in .htaccess or at the host rather than with a plugin.

Next.js

In `next.config.js` redirects, `permanent: true` returns 308 and `permanent: false` returns 307. In App Router code, `redirect()` returns 307. Use `permanentRedirect()` from `next/navigation` for permanent moves. On Vercel, set `"permanent": true` in `vercel.json` redirects.

Cloudflare

Under **Rules > Redirect Rules** (or **Bulk Redirects**), edit the rule and change **Status code** from 302 or 307 to 301 or 308. If you still use legacy Page Rules with **Forwarding URL**, set them to 301 or migrate them to Redirect Rules. The **Always Use HTTPS** toggle already issues a 301.

Shopify

Redirects under **Settings > Apps and sales channels > Online Store > URL Redirects** (older path: **Online Store > Navigation > URL Redirects**) are always 301. Temporary redirects on Shopify usually come from apps, theme JavaScript or Markets locale and country redirection. You can't change the status code of those platform-level redirects, so make sure your internal links point to the final URLs instead.

Wix / Webflow

The Wix URL Redirect Manager (**Dashboard > Marketing & SEO > SEO > URL Redirect Manager**) and Webflow 301 redirects (**Site settings > Publishing > 301 redirects**) both issue 301s. Any 302 you see is likely coming from a CDN or proxy in front of the site, or from a domain-connection forwarding setting at your registrar.

Check that it worked

✅ How to verify

  • Run `curl -sIL` on each previously flagged URL and confirm no hop returns `HTTP/1.1 302`, `HTTP/2 302` or `307`.
  • In Chrome DevTools, open the **Network** tab, tick **Preserve log**, load the old URL and check that the Status column shows 301 or 308.
  • Recrawl with Screaming Frog and filter **Response Codes > Redirection (3xx)** by status code to make sure no unintended 302 or 307 remains.
  • Use Google Search Console **URL Inspection** on the new URL and request indexing. After recrawling, the old URL should show as a redirect to the new one.

⚠️ Common mistakes

  • Using Apache's `[R]` flag or a bare `Redirect` directive, both of which silently default to 302.
  • Fixing the redirect at the origin but leaving a 302 rule at the CDN or registrar, which still answers first.
  • Changing genuinely temporary redirects (login walls, maintenance, geo selection) to 301. Browsers then cache them and keep sending users away after the condition ends.
  • Testing only the browser address bar, where cached responses hide the real status code, instead of using curl or a fresh session.

Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.

Check my site free

FAQ

Is a 302 redirect bad for SEO?

Not when the move is truly temporary. For permanent moves, it delays Google moving indexing and signals to the new URL, and it can leave the old URL showing in search results. Use 301 or 308 for anything that won't be reverted.

What is the difference between 301 and 308, and 302 and 307?

301 and 308 are both permanent; 308 guarantees the browser keeps the original method (for example, POST). 302 and 307 are both temporary, and 307 likewise keeps the method. For ordinary page moves, Google treats 301 and 308 the same way.

Why does Chrome show a 307 Internal Redirect on my site?

That is Chrome applying your HSTS policy locally before any request is sent, not a response from your server. Crawlers and curl won't see it. If curl also shows a 307, though, the server or CDN is issuing it and you should change it.

How long should I keep 301 redirects in place?

Keep them for at least a year, and ideally indefinitely for URLs that have backlinks. Removing them turns old links into 404s and throws away the signals the redirect passed to the new URL.