301 redirect (moved permanently)

A 301 redirect is an HTTP response that tells browsers and crawlers a URL has moved to a new address for good. Google follows it and uses it as a strong signal that the target should become the canonical URL, so the new address inherits the old one's place in search. It is the standard tool for migrations, URL changes and merging duplicate addresses.

A 301 redirect permanently sends a URL to a new address. Google follows it, treats the target as the canonical and shows the new URL in results; set it server-side and point each old URL to its direct replacement.

How it looks

The response carries the status and a Location header with the new address. Nothing else matters to the client.

HTTP/1.1 301 Moved Permanently

Location: https://example.com/new-page/

Follow it with curl to see the full chain:

curl -sIL https://example.com/old-page/

A clean move shows two responses: the 301 and then a 200 from the target. More than that is a redirect chain, covered below.

How Google handles it

Google's documentation on redirects and Search splits redirects into permanent and temporary. For permanent ones, Googlebot follows the redirect and the indexing pipeline uses it as a signal that the target should be canonical, so the new target is what appears in results. Google recommends a permanent server-side redirect whenever possible as the best way to make sure both people and Search reach the correct page. HTTP 301 and 308 both mean "moved permanently".

The HTTP status codes page adds the crawl-side details: Google ignores any content from the redirecting URL and processes the target instead, 301 is a strong signal, 302 a weak one, and 308 is treated as equivalent to 301. Google's crawlers follow up to 10 redirect hops by default; what happens past that limit is described in the entry on redirect chains and loops.

After a redirect, Google keeps both addresses: per the redirects documentation, one becomes the canonical and the other an alternate name that may still appear occasionally in results. This is normal and fades over time.

Ways to set it up

Apache (.htaccess or httpd.conf), the simplest form with mod_alias, as shown in Google's documentation:

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

For patterns, mod_rewrite:

RewriteEngine on

RewriteRule "^/service$" "/about/service" [R=301,L]

nginx, inside the server block:

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

For a whole directory with a captured path:

rewrite ^/blog/(.*)$ https://example.com/articles/$1 permanent;

Cloudflare: a Redirect Rule in the dashboard with a matching expression on the request URL, a target URL and status code 301. Bulk Redirects accept a list of source and target pairs for large migrations.

WordPress: redirect plugins add a rule table in the admin panel where you enter the source path, the target URL and the type (301). Check after a plugin update that the rules are still active, and avoid targets that redirect again.

PHP, before any output, as in Google's example:

header('HTTP/1.1 301 Moved Permanently');

header('Location: https://www.example.com/newurl');

exit();

Whatever the method, the target should be the final URL: HTTPS, the right host, trailing slash as the site uses it.

301 vs 302 vs 308

CodeMeaningHow Google reads it
301Moved permanentlyStrong signal; target becomes canonical
308Moved permanently, method preservedEquivalent to 301
302Found, temporaryWeak signal; source may stay in results
307Temporary, method preservedEquivalent to 302

Google's HTTP status codes page notes that although Google treats 301 and 308 the same, they are semantically different, and asks you to use the appropriate one so other clients benefit. The full decision guide is in the entry on 301 vs 302 redirects.

When to use it

  • Changing a URL's slug, directory or extension.
  • Moving to a new domain or from HTTP to HTTPS; the full procedure is in the website migration checklist.
  • Merging duplicate addresses (www, trailing slash, uppercase) into one canonical version.
  • Replacing a removed page with its direct successor.

Do not use a 301 for a page that will come back, for A/B tests or for maintenance; those are jobs for a temporary redirect or a 503.

Common mistakes

MistakeEffect
Redirect chain (old to http to www to final)Each hop costs a request; Google stops after 10 hops
Redirecting to a URL that returns 404 or 410Users and Google land on an error; the old URL's signals go nowhere
Redirect loopPage never loads; Search Console reports a redirect error
All old URLs sent to the home pageNo relevant target; old pages lose their place in results
302 used for a permanent moveGoogle may keep showing the old URL
Redirect set only in a plugin, lost on reinstallOld URLs silently return 404 again

How to check it

curl -sIL https://example.com/old-page/ prints every hop. Count the status lines: one 301 and one 200 is correct. In browser devtools, enable "Preserve log" in the Network tab, load the old URL and read the status column; each hop is its own row.

In Search Console, a redirecting URL shows in the Pages report as Page with redirect, which is expected for a source URL. Loops and chains that are too long show as Redirect error. The URL Inspection tool reports the tested URL, not the target, so inspect the target separately.

The redirect checker lists every hop with its status code, target, timing and headers for up to 10 URLs, which is the fastest way to catch chains after a migration.

How IndexRise monitors it

IndexRise records the status code of every monitored URL in the baseline and compares it each night. A URL that used to answer with 200 and starts redirecting raises a critical "monitored URL redirects" event with the target and the number of hops shown, because an unplanned 301 on a ranking page is a silent way to lose it. A chain that returns to a visited URL is flagged as a redirect loop, and a redirect that disappears so the old URL returns 404 is reported as a 4xx error. When the URL behaves like the baseline again, the event closes itself.

A 301 is only as good as its target. Point each old URL at the one page that replaces it, verify the chain ends in a single 200, and keep the rule in place for as long as anything links to the old address.
Check it on your siteRedirect checkerThe full chain with status codes, targets and headers — up to 10 URLs at once.

Frequently asked questions

Does a 301 redirect pass ranking signals?

Google's documentation says a permanent redirect is a strong signal that the target should be processed and shown in results instead of the source. In practice the target takes over the old URL's position once Google recrawls both.

How long should I keep a 301 in place?

As long as anything still points to the old URL: external links, bookmarks, old sitemaps. Google keeps the old URL as an alternate name for a while, so removing the redirect early turns those requests into 404s.

301 or 308: which one should I use?

Google treats them the same. 308 additionally guarantees that the request method and body are preserved, which matters for POST requests; for ordinary page moves 301 is the common choice.

Can I redirect everything to the home page after a migration?

Avoid it. Each old URL should point to the page that replaces it. A bulk redirect to the home page does not help users and the old URLs' signals are not consolidated into relevant pages.

Is a meta refresh as good as a 301?

Google interprets an instant meta refresh as a permanent redirect, but ranks server-side redirects as the most likely to be understood correctly. Use a 301 whenever you can change the server configuration.

How do I see whether a URL returns 301?

Run curl -I on the URL and read the first line and the Location header, or use a redirect checker that lists every hop with its status code.

Updated: 2026-10-20