> ## Content Index
> Fetch the complete content index at: https://www.growthcentr.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Set Up 301 Redirects: A Step-by-Step Guide for SEO
- URL: https://www.growthcentr.com/301-redirects/
- Published: 2026-12-05T07:51:26.000Z
- Updated: 2026-12-05T07:51:26.000Z
- Description: Google treats a 301 as a strong signal that the new URL should rank. Map, write, test and maintain permanent redirects without losing traffic.
- Author: Vuksan Djurcevic
- Tags: SEO, Technical SEO, Guide, 2026

## Key Takeaways

A 301 redirect tells browsers and Google that a page has moved for good, and Google uses it as a signal that the new URL should be canonical. Google's documentation recommends permanent server-side redirects whenever possible and keeping them for at least a year after a move.

- Use 301 or 308 when a move is permanent.
- Use 302, 303 or 307 when the move is temporary.
- Server-side redirects are the most reliable for Google.
- Redirect each old URL straight to its final destination.
- Keep redirects live for at least one year.

## What a 301 redirect does

### A permanent change of address

Google's guide to [redirects and Google Search](https://developers.google.com/search/docs/crawling-indexing/301-redirects?ref=growthcentr.com) describes a redirect as resolving an existing URL to a different one. HTTP 301 means "moved permanently", and Google shows the redirect target in search results.

Googlebot follows the redirect, and the indexing pipeline treats it as a signal that the target should be the canonical URL. That is why a 301 is the standard tool when a page's address changes for good.

### When you need one

Google lists four common situations where redirects help:

- You moved your site to a new domain.
- Your home page or other pages load on several different URLs.
- You are merging two websites.
- You removed a page and want to send users to a new one.

Each case calls for a one-to-one plan, not a blanket rule that sends everything to the home page.

### Redirects and link value

Google's site move documentation states that 301 and other permanent redirects do not cause a loss in PageRank. You do not need to fear a redirect, but you do need to set it up correctly.

## Step 1: decide between permanent and temporary

### Permanent status codes

Google groups 301 and 308 as permanent server-side redirects. An instant meta refresh of 0 seconds and a JavaScript location change are also treated as permanent, but Google ranks them as less reliable.

Use a permanent redirect only when you are sure it will not be reverted. Once Google has switched the canonical to the new URL, flipping back adds confusion.

### Temporary status codes

The temporary group covers 302, 303 and 307, plus a meta refresh with a delay of more than 0 seconds. Google follows these, but the indexing pipeline does not use them as a signal that the target should be canonical.

That suits short detours, such as sending users to a notice page while a service is offline. The original URL can keep its place in search results.

### A quick rule of thumb

Ask whether the old URL will ever come back. If the answer is no, use a 301, and if the answer is yes or maybe, use a 302.

## Step 2: map every old URL to a new one

### Build a redirect map

Before changing anything, list every URL that will move and pair it with its closest equivalent. A spreadsheet with an old URL column and a new URL column is enough for most sites.

Pull the list from your CMS, server logs and the URLs submitted in your [XML sitemap](https://www.growthcentr.com/how-to-create-an-xml-sitemap/). Pages with backlinks or steady traffic deserve the most care.

### Avoid irrelevant redirects

Google warns against redirecting many old URLs to one irrelevant destination, such as the new home page. It says this can confuse users and might be treated as a **soft 404 error**.

The exception is consolidation. If several old pages were merged into one new page, redirecting all of them to that page is fine.

### Cover every URL variant

For domain moves, Google advises redirecting all variants of the old domain, including subdomains and www and non-www versions. Include HTTP versions as well if they ever served content.

## Step 3: write the redirect rules

### Apache

On Apache, Google's examples use the mod\_alias directive Redirect permanent "/old" "https://example.com/new" in the .htaccess file or server configuration. For pattern-based rules, mod\_rewrite supports a RewriteRule with the R=301 flag.

### NGINX

On NGINX, the documented pattern is a location block with return 301 followed by the new URL. More complex patterns use the rewrite directive with the permanent flag.

### PHP and application code

If you cannot edit server files, Google shows a PHP example that sends a "301 Moved Permanently" header and a Location header before any output. The example ends with exit() straight after the headers.

### Hosted platforms

Google notes that platforms such as Blogger and Shopify may already have built-in redirect tools. Check your platform's help pages before writing custom code.

## Step 4: use fallbacks only when you must

### Meta refresh

If server-side redirects are impossible, an instant meta refresh with content="0" is interpreted by Google as permanent. A delayed meta refresh is read as temporary.

### JavaScript redirects

Google advises using JavaScript redirects only when server-side and meta refresh options are not available. Rendering can fail, so Google might never see a redirect that lives only in script.

### A plain link as a last resort

Google calls a simple "we moved" link a crypto redirect and says not to rely on it unless there is no other choice. Contact your hosting provider before you settle for it.

## Step 5: avoid chains and test every rule

### Point straight to the final URL

Googlebot can follow up to 10 hops in a redirect chain, but Google advises redirecting to the final destination directly. If a chain is unavoidable, keep it ideally to no more than 3 hops and fewer than 5.

Chains add latency for users, and not every browser supports long ones. When you redirect a page that was already redirected, update the older rule too.

### Test before and after launch

Google suggests the URL Inspection Tool for individual URLs and command line tools or scripts for large batches. Check that each old URL returns a 301 and lands on a page that returns 200.

### Align your other signals

Once redirects are live, update internal links, rel="canonical" tags and sitemaps to point at the new URLs. Mixed signals slow down the switch, a point covered in our guide to [canonical tags](https://www.growthcentr.com/canonical-tags/).

## Step 6: monitor and keep redirects in place

### How long to keep them

Google's [site move guidance](https://developers.google.com/search/docs/crawling-indexing/site-move-with-url-changes?ref=growthcentr.com) says to keep redirects for as long as possible, generally at least 1 year. That gives Google time to transfer signals and reassign links from other sites.

From a user's point of view, Google suggests considering keeping them indefinitely. Old bookmarks and links from other sites can keep sending visitors for years.

### Expect old URLs to linger

Google keeps track of both the redirect source and the target, and the non-canonical one becomes an alternate name. After a domain move, old URLs may still appear occasionally in results, which Google calls normal.

### Monitor indexing in Search Console

Use the Index Status and Sitemaps reports in [Google Search Console](https://www.growthcentr.com/google-search-console/) to confirm that new URLs are being indexed. For domain changes, Google also recommends submitting a Change of Address for the old site.

## Common mistakes to avoid

### Leaving migration blocks in place

Google's list of common site move mistakes includes forgetting to remove noindex tags or robots.txt blocks used during the migration. These can stop the new site from being indexed.

### Mixing up 301 and 302

A 302 on a permanent move keeps the old URL in search results longer than you want. On GrowthCentr arithmetic, a site with 500 moved URLs and a 2% error rate would leave 10 pages with the wrong status, so audit the full list.

### Redirecting to pages that do not exist

A redirect that ends in a 404 is a dead end for users and crawlers. Re-test the map after every template, slug or category change.

## Conclusion

A 301 redirect is the clearest way to tell Google that a page has moved for good, and Google says permanent server-side redirects do not cost PageRank. Map every old URL to its closest match, avoid chains and soft 404 patterns, test each rule and keep the redirects live for at least a year.

## Frequently Asked Questions

### What is a 301 redirect?

A 301 redirect is an HTTP status code meaning "moved permanently", which sends users and Google to a new URL and signals that the new URL should be canonical.

### What is the difference between a 301 and a 302 redirect?

Google treats a 301 as permanent and shows the target in results, while a 302 is temporary and usually keeps the source URL in search results.

### Do 301 redirects lose PageRank?

No, Google's site move documentation states that 301 and other permanent redirects do not cause a loss in PageRank.

### How long should I keep a 301 redirect?

Google recommends keeping redirects for as long as possible, generally at least one year, and suggests considering keeping them indefinitely for users.

### How many redirects can Googlebot follow in a chain?

Googlebot can follow up to 10 hops, but Google advises ideally no more than 3 and fewer than 5.

### Is a 308 redirect the same as a 301?

Google groups 308 with 301 as a permanent server-side redirect that it uses as a canonical signal.

### Can I redirect deleted pages to my home page?

Google advises against it, because redirecting many old URLs to one irrelevant page can confuse users and may be treated as a soft 404.

*Sources: Google Search Central, Redirects and Google Search; Google Search Central, Site moves with URL changes. Figures checked 5 December 2026\. Server syntax follows Google's examples; test rules on your own setup.*