What Is a 301 Redirect and When Should You Use One

7 sections 4 min read

A 301 redirect is a server response that says a page has moved permanently to a new URL. Browsers send visitors to the new address, and Google treats the redirect as a signal that the new URL should replace the old one in search results. Use one whenever a URL changes for good: a site move, a new URL structure, an HTTP to HTTPS switch, or merging two pages into one. For a change you plan to reverse, use a temporary redirect instead.

Permanent and Temporary Redirects

Google’s redirect documentation frames the choice by what should appear in search results:

Redirect Status codes What Google does
Permanent 301, 308 Follows the redirect and uses it "as a signal that the redirect target should be canonical"; shows the new URL once the move is processed
Temporary 302, 303, 307 Follows the redirect but does not treat it as a canonical signal; shows the source URL

Google’s advice for permanent redirects: “Use permanent redirects when you’re sure that the redirect won’t be reverted.” For temporary ones, the documentation gives the example of a service that is briefly unavailable, where a temporary redirect sends users to an explanation “without compromising the original URL in search results.”

Choosing the wrong one has a cost. A 302 used for a move that is in fact permanent tells Google to keep showing the old URL, although the documentation adds: “The target page might still be indexed if other canonicalization signals are present.” When the move is permanent, say so with a 301 or 308.

Do Redirects Lose Ranking Value?

No. Google’s site move documentation states: “301 and other permanent redirects don’t cause a loss in PageRank.” What causes problems is implementation: wrong status codes, chains, and redirects to pages that do not match the old content. No PageRank loss is not a promise of unchanged traffic either; the same documentation tells site owners: “Expect temporary fluctuation in site ranking during the move.” Google recrawls and reindexes in the meantime.

Server-Side, Meta Refresh, and JavaScript Redirects

Google lists redirect methods “ordered by how likely Google is able to interpret correctly,” with server-side redirects first: “a server side redirect has the highest chance of being interpreted correctly by Google.” A meta refresh with a delay of 0 seconds counts as permanent; JavaScript redirects come next, with Google’s advice: “Only use JavaScript redirects if you can’t do server-side or meta refresh redirects.”

On Apache, a permanent redirect can be as simple as:

Redirect permanent "/old" "https://example.com/new"

On NGINX:

location = /service {
    return 301 $scheme://example.com/about/service;
}

The two examples match differently. Apache’s Redirect directive covers the given path and everything below it, matching whole path segments only: with the rule above, /old and /old/page are redirected, but /older is not. Its documentation states, “Additional path information beyond the matched URL-path will be appended to the target URL,” so /old/page goes to /new/page. The NGINX location = block is an exact match and covers only /service. The NGINX example also keeps the request’s protocol through $scheme; for an HTTPS migration, write https:// into the target instead. Test each rule with sample URLs, including subpaths and query strings, before it goes live.

Chains and Loops

A chain is a redirect that leads to another redirect before reaching the final page. Google’s HTTP status code documentation notes: “By default, Google’s crawlers follow up to 10 redirect hops.” Its crawl budget guidance advises avoiding long chains because they hurt crawling. A loop, where URLs redirect to each other with no final page, leaves the content unreachable for visitors and crawlers alike. After each migration, update old redirects so every one points straight at the current final URL.

When to Use a 301

  • Site moves. Moving to a new domain, to HTTPS, or to a new subdomain. Google’s site move guide starts with a map: “Prepare a URL mapping from the current URLs to their corresponding new format.”
  • URL structure changes. New slugs, a new category structure, or a CMS change, mapped one URL at a time.
  • Merging pages. When two pages cover the same topic, redirect the removed one to the page that keeps the content.
  • Retired pages with a true successor. A discontinued product can redirect to its replacement, or to a category that offers the same kind of product; where no such page exists, a 404 or 410 with a useful error page is the accurate answer.

Redirecting many unrelated URLs to the homepage is not a substitute for that mapping: a visitor who wanted a specific page lands somewhere that does not answer the request.

How Long to Keep Redirects

Google’s site move guide: “Keep the redirects for as long as possible, generally at least 1 year.” Visitors and crawlers keep arriving at old URLs through bookmarks, external links, and old references long after a move.

Checking Redirects

  • For a few URLs, check the status code directly, for example with curl -I, and confirm it is a 301 or 308 that points at the final URL.
  • After a migration, crawl the whole site with a tool such as Screaming Frog to list every chain, loop, and redirect with the wrong status code.
  • In Search Console, use URL Inspection on key old URLs and the Page indexing report, where redirected URLs appear as “Page with redirect” once Google has processed them.