Exploring Redirects: 301 vs 302 for Domains

Exploring Redirects: 301 vs 302 for Domains

SEO guide explaining exploring redirects: 301 vs 302 for domains. Learn the best practices, setups, and automation tricks.

SEO TLDix Editorial Team Published: Updated: 6 min read

What a redirect actually does

A redirect is an HTTP response that tells a browser or crawler to request a different URL. The server sends a 3xx status code and a Location header with the new address. The client then follows that address automatically.

HTTP/1.1 301 Moved Permanently
Location: https://new.example/pricing

For users, every redirect type looks almost the same: they end up on the new page. For search engines and for some client software, the specific status code carries important meaning about whether the change is permanent and whether the request should be repeated exactly.

⚡ TLDix Instant Tools

Inspect Any Domain and Web Hosting Instantly

Inspect the infrastructure of any domain or website in seconds using TLDix WHOIS Domain, Hosting Lookup and Domain Oracle (AI).

🔍 Domain WHOIS 🖥️ Hosting Lookup 🔮 Domain Oracle ✨ Sign Up Free →

The four redirect codes compared

HTTP semantics, currently defined in RFC 9110, specify several redirect codes. Four of them matter for websites and domains.

CodeNamePermanent?Method preserved?Google treatment
301Moved PermanentlyYesNot guaranteed; clients may change POST to GETStrong signal that the target is canonical
302FoundNoNot guaranteed; clients may change POST to GETWeak signal; source usually stays indexed
307Temporary RedirectNoYesSame as 302
308Permanent RedirectYesYesSame as 301

A 303 See Other also exists, mainly for sending a client to a result page after a form submission; Google treats it as temporary. Meta refresh and JavaScript redirects work too, but server-side redirects are the clearest and most reliable option.

How Google treats permanent versus temporary redirects

Google’s documentation describes permanent redirects as a strong signal that the redirect target should be the canonical URL, so it will usually show the new URL in search results. Temporary redirects are a weaker signal: Google typically keeps the original URL indexed, because you have said it will return.

Two points are frequently misunderstood:

  • Signals and PageRank. Google has stated that 3xx redirects, including 302s, do not lose PageRank. The difference between 301 and 302 is mainly about which URL is shown and treated as canonical, not about a penalty.
  • Long-lived temporary redirects. If a 302 stays in place for a long time, Google may decide it is effectively permanent and start treating the target as canonical. That is a fallback, not something to rely on. If the move is permanent, say so with a 301 or 308.

Other search engines, including Bing, also recommend 301 for permanent moves, so choosing the correct code helps beyond Google.

When to use 301 or 308

Use a permanent redirect whenever the old URL should be replaced by the new one in indexes, bookmarks and caches.

  • Domain changes and rebrands. Every old URL should 301 to its equivalent on the new domain. Our site migration guide covers the full process, including the Search Console Change of Address tool.
  • HTTP to HTTPS. Redirect all plain HTTP requests to HTTPS permanently.
  • www and non-www consolidation. Pick one host and permanently redirect the other.
  • Merged or renamed pages. When two articles become one, redirect the retired URL to the combined page.
  • Extra domains you own. Typo domains, old brand names and alternative extensions can permanently redirect to your main site.

Choosing between 301 and 308

For ordinary page requests, 301 is the most widely understood choice and is perfectly safe. Choose 308 when non-GET requests, such as POST requests to an API endpoint or a form handler, must be repeated at the new location with the same method and body. Browsers and HTTP libraries are allowed to turn a POST into a GET after a 301, which can silently break submissions.

When to use 302 or 307

Use a temporary redirect only when you genuinely intend the original URL to come back.

  • Short maintenance windows where a page sends visitors to a status notice. For full-site maintenance, a 503 Service Unavailable response with a Retry-After header is often better, because it tells crawlers to come back later.
  • Time-limited campaigns or seasonal promotions.
  • A/B tests that send part of the traffic to a variant URL. Google’s guidance on testing recommends temporary redirects for this.
  • Geolocation or language suggestions, used carefully. Do not force crawlers away from content they need to see; hreflang annotations are the preferred way to signal language versions.

Pick 307 over 302 when a non-GET request must keep its method and body. Note that browsers also show an internal 307 when they upgrade to HTTPS because of HSTS; that redirect happens inside the browser, and crawlers still see your server’s real response. See our article on HTTP Strict Transport Security for more.

Configuration examples

Nginx: whole domain, permanent

server {
    listen 80;
    listen 443 ssl;
    server_name old.example www.old.example;
    return 301 https://new.example$request_uri;
}

Nginx: single page, temporary

location = /summer-sale {
    return 302 /offers;
}

Apache (.htaccess)

Redirect 301 /old-page https://new.example/new-page
Redirect 308 /api/v1/submit https://new.example/api/v1/submit
Redirect 302 /promo https://new.example/offers

Testing what a URL returns

curl -sIL https://old.example/old-page | grep -i -E "^HTTP|^location"

The -L flag follows every hop, so you can see the full chain and confirm it ends with a 200 response. Hosting control panels and some registrars offer domain forwarding as well; check which status code they use, because some default to 302 or use frames that hide the real URL.

Common redirect mistakes

MistakeWhy it hurtsFix
Using 302 for a permanent moveOld URLs may stay indexed and canonical signals are unclearSwitch to 301 or 308
Redirect chainsSlower for users; Googlebot follows only a limited number of hopsPoint every old URL straight to the final target
Redirect loopsThe page never loads and cannot be indexedTest rules for every host and protocol combination
Everything to the homepageOften treated as soft 404s; users lose contextMap each URL to its closest equivalent
Expired SSL on the old domainBrowsers show errors before the redirect is reachedKeep certificates valid while redirects run
Letting the old domain lapseAll redirects stop and the name can be registered by othersKeep it on auto-renew and monitor expiry

Google has said Googlebot follows up to around ten redirect hops before giving up, but each hop adds latency, so aim for a single redirect.

Redirecting multiple domains safely

Many organisations own several domains that all point to one main site: older brand names, typo variants, country extensions and campaign names. Redirects let you use them without creating duplicate content, but they need a consistent approach.

Choose one canonical destination

Decide on a single primary host, for example https://www.brand.example or https://brand.example, and make every other domain and protocol variant redirect permanently to it. Serving the same content on several domains with a 200 response splits signals and forces search engines to guess which version to show.

Preserve paths where they exist

If an old domain once hosted real pages, redirect each path to its equivalent rather than sending all traffic to the homepage. If a domain never had content, such as a defensive typo registration, a simple redirect to the homepage is fine because there are no deep links to preserve.

Mind HTTPS on every domain

Users increasingly type or click HTTPS links, and browsers may try HTTPS first. A redirect-only domain therefore still needs a valid certificate; otherwise visitors see a security warning instead of being forwarded. Free automated certificates make this straightforward, but each domain must resolve to a server that can complete validation.

Document the setup

Keep a simple list of every redirecting domain, where it points, which code it uses, who manages its DNS and when it renews. That list makes audits, server moves and staff handovers far less risky, and it helps you spot domains you no longer need.

Keeping redirects working over time

Redirects are only as reliable as the domain, DNS and certificate behind them. A redirecting domain receives little attention because nobody visits it on purpose, which is exactly why it is often the one that expires. Add every redirecting domain to TLDix domain monitoring so you get alerts before renewals are due, and periodically check hosting details with a hosting lookup after server changes.

Also review your redirect rules after CMS upgrades, server moves and plugin changes, which can quietly override them. A short monthly crawl of key legacy URLs is usually enough to catch regressions before they affect traffic.

Frequently asked questions

Is a 302 redirect bad for SEO?
Not in itself. A 302 does not lose PageRank, but it tells Google the move is temporary, so the original URL usually stays indexed and canonical. That is correct for maintenance, tests and short campaigns. It becomes a problem when used for a permanent move, because the old URL may linger in results and signals consolidate more slowly than with a 301.
What is the practical difference between 301 and 308?
Both are permanent and Google treats them the same way. The difference is how clients handle the request method. After a 301, browsers may turn a POST request into a GET, dropping the submitted data. A 308 requires the client to repeat the same method and body at the new URL, which makes it the safer choice for APIs and form endpoints.
How long should a domain redirect stay in place?
Google recommends keeping redirects for at least one year after a site move, which gives it time to process signals. In practice, keeping them permanently is better, because old backlinks, bookmarks and emails continue sending visitors for years. That also means keeping the old domain renewed and its SSL certificate valid for as long as the redirects run.
Is registrar domain forwarding as good as a server redirect?
It can be, if the forwarding service issues a real 301 redirect and supports HTTPS on the old domain. Some services default to a 302 or use masked forwarding with frames, which hides the destination URL and is weak for SEO. Test the forwarded domain with curl or a redirect checker to confirm the status code and final destination.
Why does my browser show a 307 that my server never sent?
That is usually an internal redirect created by the browser because of HSTS. Once a site has sent a Strict-Transport-Security header, or is on the preload list, the browser upgrades HTTP requests to HTTPS itself and reports it as a 307. Search engine crawlers still see your server’s actual response, so it does not affect how your redirects are evaluated.
Frequently Asked Questions

Everything You Need to Know

Find answers about domain lookups, WHOIS, pricing, and AI Domain Oracle on TLDix.com.