Article
Redirects and Google: 301, 302, meta refresh and JS
Short answer
If a page has moved for good, use a server-side 301 or 308 redirect. Google says that’s “the best way to ensure that Google Search and people are directed to the correct page” (Google Search Central). Use a 302 or 307 only when the move is temporary and you want the old URL to keep its place in results (Google Search Central).
That’s most of it. The rest is about what to do when your platform won’t let you set server redirects, and why old URLs sometimes hang around after a move.
Permanent vs temporary, in one table
Google says the choice depends on how long the redirect will stay and which page you want shown in results (Google Search Central):
| Permanent | Temporary | |
|---|---|---|
| Shown in results | The new target (Google Search Central) | The source page (Google Search Central) |
| Canonical signal | Yes, target should be canonical (Google Search Central) | No, though the target may still be indexed through other signals (Google Search Central) |
| Server codes | 301, 308 (Google Search Central) | 302, 303, 307 (Google Search Central) |
| meta refresh | Instant (0 seconds) (Google Search Central) | Delayed (more than 0 seconds) (Google Search Central) |
| Use when | You’re sure it won’t be reverted (Google Search Central) | A service is briefly unavailable and you want to explain why (Google Search Central) |
Note
Note: visitors usually can’t tell the types apart (Google Search Central). Google can, and it treats them as different signals.
Methods, ranked by how reliably Google reads them
Google orders redirect methods by how likely it is to interpret them correctly, with server-side redirects having the highest chance (Google Search Central). From best to last resort:
- Server-side 301 or 308. Set in your server config (like
.htaccesson Apache) or with server code like PHP (Google Search Central). - Instant meta refresh. Google interprets an instant meta refresh as a permanent redirect (Google Search Central). A useful fallback when you can’t touch the server.
- JavaScript redirect. Google says to use these only if you can’t do server-side or meta refresh, because rendering can fail and then “Google might never see it” (Google Search Central).
- A plain link saying the page moved. Google calls this a crypto redirect and says not to rely on it unless you have no other choice (Google Search Central). (Google’s own doc compares it to the Loch Ness monster, since its existence “may be disputed” (Google Search Central).)
Watch out
Watch out: platforms like Blogger and Shopify may already have built-in redirect tools (Google Search Central). Check there before writing code.
Examples from Google’s docs
Apache, with mod_alias (Google Search Central):
# Permanent redirect:
Redirect permanent "/old" "https://example.com/new"
# Temporary redirect:
Redirect temp "/two-old" "https://example.com/two-new"An instant meta refresh in the page head (Google Search Central):
<meta http-equiv="refresh" content="0; url=https://example.com/newlocation">On NGINX, Google’s example uses return 301 for permanent and return 302 for temporary (Google Search Central).
When redirects make sense
Google lists four common cases (Google Search Central):
- You moved your site to a new domain.
- Your homepage is reachable at several URLs and you want one preferred version.
- You’re merging two websites.
- You removed a page and want to send users to a new one.
The second case trips up a lot of small sites. If example.com/home, www.example.com and the plain domain all load, Google suggests picking one as the preferred (canonical) URL and redirecting the others to it (Google Search Central).
Why old URLs still show up
After a redirect, Google keeps track of both URLs (Google Search Central). One becomes canonical, depending on signals like whether the redirect was permanent or temporary, and the other becomes an alternate name (Google Search Central).
Google says that after a domain move, “it’s very likely that Google will continue to occasionally show the old URLs in the results,” even once the new ones are indexed (Google Search Central). It calls this normal and says the old names fade on their own as users get used to the new domain (Google Search Central). So don’t panic and don’t remove the redirect.
Common mistakes
| Using 302 for a permanent move | Google won’t use the redirect as a signal that the new URL should be canonical, so the old URL may keep showing (Google Search Central). |
|---|---|
| Chaining redirects | Our read: point every old URL straight at its final destination, not through a series of hops. |
| Redirecting everything to the homepage | Our read: send each old URL to its closest match. A blanket homepage redirect throws away the match between the old page and its replacement. |
| Relying on JavaScript alone | If rendering fails, Google may never see the redirect (Google Search Central). |
Key takeaway
What to do next
List the URLs you’ve moved or deleted this year. For each, load the old URL and check where it lands and with which code (your browser’s developer tools show it). Change any 302 that should be permanent to 301. Read how Be In GEO works for how we log site changes.
Get the worksheet
Want to see which sites AI answers cite for the questions your customers ask? Grab the free worksheet at beingeo.com/checklist. You’ll also get short emails with each new teardown.
FAQ
Is a 308 the same as a 301 to Google?
Both are permanent redirects in Google’s table, and both mean the page has moved permanently (Google Search Central).
Does an instant meta refresh count as a 301?
Google interprets an instant meta refresh as a permanent redirect, and a delayed one as temporary (Google Search Central).
Why does Google still show my old domain?
Google may show old URLs occasionally after a move, as alternate names, and says they fade over time (Google Search Central).