BF50 Black Friday · 50% off all plans
from $5/mo · Auto-applied ---:--:-- Claim 50% off →
Skip to content

Search Seonio

Type a keyword, domain, or paste a URL

Start free with $1 to see full results. Powered by Seonio
SEO

Redirect: Which type to use and how Google sees it

A redirect sends visitors and search engines from one URL to another. Which type to use, how Google treats each one, and the mistakes that cost traffic.

Monthly searches · redirect
135.0k
Keyword research data
redirect
Redirect: Which type to use and how Google sees it
Click the image to view it full size

A redirect sends anyone who asks for one URL to a different URL. When a browser or search engine crawler requests the old address, the server answers with a status code in the 3xx range and the new location, and the browser loads that page instead. Visitors rarely notice; search engines do, and the type of redirect you choose tells them which URL to show in results.

You need redirects whenever a URL changes: you move to a new domain, rename a page, merge two pages into one, or want several versions of an address (http://, www, a trailing slash) to end up at one preferred URL.

Permanent or temporary: the choice that matters most

Every redirect is either permanent or temporary, and Google treats them differently Google Search Central:

The change is Use What Google shows in results
Permanent: the old URL won't come back 301 or 308 The new URL. Google takes the redirect as a strong signal that the target should be the canonical URL.
Temporary: the old URL will return 302 or 307 (303 after a form) The old URL. Google follows the redirect but doesn't treat it as a sign that the target should replace the source.

A product page that's moved for good gets a 301. A page that's down for maintenance, with users sent to a status page for a day, gets a 302. Bing is stricter about the difference: its guidelines say to use 302 only for very short-term changes of less than two days.

301 vs 308, 302 vs 307

For Google, 308 is equivalent to 301, and 307 to 302. The difference matters to browsers and apps when the request isn't a simple page view:

  • 301 and 302 may turn a form submission (POST) into a plain page request (GET) on the way to the new URL.
  • 308 and 307 keep the request method and its data unchanged.
  • 303 deliberately sends the browser to a page with GET, typically a confirmation page after a form is submitted.

For ordinary page moves, 301 is fine. Use 308 or 307 for URLs that receive form posts or API calls. Google suggests using the code that fits, since other clients may rely on the difference.

Server-side, meta refresh, JavaScript

In order of preference:

  1. Server-side (HTTP) redirects. Set in your server configuration, such as an .htaccess file on Apache, in server code, or through your CMS or host. Google says these have the best chance of being read correctly, and they run before anything else.
  2. Meta refresh. A <meta http-equiv="refresh"> tag in the page's HTML, for when you can't change the server. Google reads a zero-second refresh as permanent and a delayed one as temporary. Set it to 0: delayed refreshes also cause accessibility problems.
  3. JavaScript redirects. Setting window.location in a script. Google only sees the redirect if it renders the page, and rendering can fail, so use this only when the other two aren't possible. See JavaScript.

If none of these is possible, put a clear "We've moved" link on the old page. Google may treat it as a redirect, but it says not to rely on that.

How to set one up

On Apache, one line in .htaccess redirects a page permanently:

Redirect 301 /old-page https://www.example.com/new-page

Include the 301: Apache's Redirect directive defaults to a temporary 302 when you leave the code out. On Nginx, a return 301 line does the same, for example return 301 https://www.example.com/new-page; in the block that matches the old URL. Most CMS platforms and website builders have a redirect setting or plugin that does the same without touching server files.

To check a redirect, request the old URL and read the response, for example with curl -I https://www.example.com/old-page in a terminal, or the URL Inspection tool in Google Search Console.

Mistakes that cost traffic

  • Redirect chains. A redirects to B, which redirects to C. Google's crawlers follow up to 10 hops, but Google advises pointing straight at the final URL and, if you can't, keeping chains to no more than 3 hops and fewer than 5. Each hop slows the visitor down.
  • Redirect loops. A sends to B and B sends back to A. Browsers give up with an error, and the page can't be crawled.
  • Sending everything to the home page. Redirecting many removed pages to one unrelated page confuses visitors, and Google may treat it as a soft 404. Redirect each old URL to its closest match; if there's none, let it return a 404.
  • Leaving internal links on old URLs. Redirects are slower than direct links. After a move, update your internal links, navigation, sitemap and canonical tags to the new URLs.
  • Removing redirects too soon. For a site move, Google advises keeping redirects for at least a year, so it can transfer all signals, and from a user's point of view, indefinitely.
  • Using a temporary redirect for a permanent move. Google keeps showing the old URL in results instead of the new one.

Redirects in a site move

When you move a whole site to a new domain, redirect every old URL to its matching new URL with a 301 or 308, not everything to the new home page. Then use the Change of Address tool in Search Console. That tool is only for moves between domains or subdomains; you don't need it for HTTP to HTTPS, www to non-www, or moving folders within one domain.

Expect the old URLs to appear in results now and then for a while: Google keeps track of both addresses and may show the old one as an alternate name when a searcher's query suggests they trust it. For how the status codes around redirects work, see HTTP status codes; for how signals carry over, see link equity.

Seonio

Put it to work on your own site

Keyword research, traffic, backlinks and clustering in one place. Start with a free $1 to test, no card required.