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.
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.
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).
The four redirect codes compared
HTTP semantics, currently defined in RFC 9110, specify several redirect codes. Four of them matter for websites and domains.
| Code | Name | Permanent? | Method preserved? | Google treatment |
|---|---|---|---|---|
| 301 | Moved Permanently | Yes | Not guaranteed; clients may change POST to GET | Strong signal that the target is canonical |
| 302 | Found | No | Not guaranteed; clients may change POST to GET | Weak signal; source usually stays indexed |
| 307 | Temporary Redirect | No | Yes | Same as 302 |
| 308 | Permanent Redirect | Yes | Yes | Same 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
| Mistake | Why it hurts | Fix |
|---|---|---|
| Using 302 for a permanent move | Old URLs may stay indexed and canonical signals are unclear | Switch to 301 or 308 |
| Redirect chains | Slower for users; Googlebot follows only a limited number of hops | Point every old URL straight to the final target |
| Redirect loops | The page never loads and cannot be indexed | Test rules for every host and protocol combination |
| Everything to the homepage | Often treated as soft 404s; users lose context | Map each URL to its closest equivalent |
| Expired SSL on the old domain | Browsers show errors before the redirect is reached | Keep certificates valid while redirects run |
| Letting the old domain lapse | All redirects stop and the name can be registered by others | Keep 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.