All posts

Blog

301 Redirects and SEO: When to Use Them and How to Set Them Up

Illustrated cover for the SEO & Marketing guide "301 Redirects and SEO: When to Use Them and How to Set Them Up"

URLs change all the time. You rename a page, reorganize your blog, switch to HTTPS or move to a new domain. Each time, any links, bookmarks and search results pointing to the old address risk leading to a dead end. A 301 redirect is how you avoid that.

Used correctly, redirects protect your visitors and your search visibility. Used carelessly, they can create chains, loops and confusing signals. This guide explains how 301 redirects work, how they affect SEO and how to set them up on common hosting setups.

What is a 301 redirect?

A 301 redirect is a server response that says, "This page has moved permanently. Go here instead." When a browser or search engine requests the old URL, the server returns the status code 301 Moved Permanently along with the new location, and the visitor is sent there automatically.

For visitors, it's seamless. For search engines, it's a strong signal that the new URL should replace the old one in their index.

301 vs 302 vs other redirects

  • 301 (Moved Permanently): Use when the move is permanent. This is the one you'll use most.
  • 308 (Permanent Redirect): Similar to 301 but preserves the request method. Search engines treat it as permanent too.
  • 302 (Found) and 307 (Temporary Redirect): Use when the move is temporary, such as during maintenance or a short promotion, and you plan to bring the original URL back.
  • Meta refresh and JavaScript redirects: These happen in the browser rather than on the server. Google can follow them, but server-side redirects are the clearer, more reliable choice.

If you use a 302 for something that is really permanent, Google may eventually treat it as permanent anyway, but it's better to send the right signal from the start.

How 301 redirects affect SEO

Google has said that 301 redirects don't cause a loss of PageRank, the value passed through links. In practice, a properly redirected page passes its signals to the new URL, which usually takes over the old page's rankings over time.

A few things still matter:

  • Relevance: Redirect to the closest equivalent page. Redirecting many unrelated pages to your homepage may be treated like a "soft 404," and the value may not carry over.
  • Time: It can take a while for search engines to recrawl and update their index after a change.
  • Keeping redirects in place: Google recommends keeping redirects for at least a year, and keeping them longer if old links still get traffic.

When to use a 301 redirect

  • You changed a page's URL or slug.
  • You merged two similar pages into one stronger page.
  • You deleted a page that has a clear replacement.
  • You moved from HTTP to HTTPS. See our guide to what SSL and HTTPS are.
  • You chose www or non-www and want to send all traffic to one version.
  • You changed domain names. Every old URL should point to its matching URL on the new domain.
  • You restructured your site during a redesign or platform change.

If a page is gone and has no reasonable replacement, it's fine to let it return a 404 or 410. Not every old URL needs a redirect.

How to set up 301 redirects

Option 1: cPanel's Redirects tool

If your host uses cPanel:

  1. Log in and open Redirects under the Domains section.
  2. Choose Permanent (301).
  3. Select the domain and enter the old path (for example, old-page).
  4. Enter the full new URL.
  5. Choose whether to redirect with or without www, then click Add.

cPanel writes the rule to your .htaccess file for you.

Option 2: Edit .htaccess (Apache and LiteSpeed)

On Apache or LiteSpeed servers, you can add rules to the .htaccess file in your site's root folder. Make a backup of the file first. A typo can take your site offline.

Redirect one page:

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

Force HTTPS and www with mod_rewrite:

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]

Redirect an entire old domain to a new one, keeping paths:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC]
RewriteRule ^(.*)$ https://www.newdomain.com/$1 [L,R=301]

In WordPress, place your custom rules above the # BEGIN WordPress block so they're processed first and aren't overwritten.

Option 3: Use a WordPress plugin

Plugins such as Redirection, or the redirect managers built into some SEO plugins, let you create and manage redirects from your dashboard. Many also log 404 errors so you can spot broken URLs that need redirecting. WordPress also tries to redirect automatically when you change a post's slug, but a plugin gives you more control.

Option 4: Nginx

On Nginx servers, redirects go in the server configuration:

location = /old-page/ {
    return 301 https://www.example.com/new-page/;
}

You'll need access to the server config and to reload Nginx afterward, so this is usually handled on a VPS or by your host.

Common redirect mistakes

Redirect chains

A chain happens when URL A redirects to B, which redirects to C. Each hop slows visitors down, and search engines may stop following long chains. Point every old URL directly to its final destination.

Redirect loops

A loop happens when URLs redirect to each other forever, and the browser shows an error like "too many redirects." These often come from conflicting rules, such as an HTTPS rule in .htaccess fighting with a plugin or CDN setting.

Redirecting everything to the homepage

It's tempting during a redesign, but it frustrates visitors and often wastes the value of old pages. Map each old URL to the most relevant new one.

Forgetting internal links

Redirects are a safety net, not a substitute for updating your own site. After a URL change, update internal links, menus and your sitemap to point to the new URL directly.

Removing redirects too soon

Old links on other websites may keep sending visitors for years. Keep redirects in place as long as practical.

How to test your redirects

  • Visit the old URL in a private browser window and confirm it lands on the right page.
  • Use an online HTTP status checker or a browser extension to confirm the status is 301 and there's only one hop.
  • From a terminal, run curl -I https://www.example.com/old-page/ and check the Location header.
  • In Google Search Console, use URL Inspection on the new URL and watch the Page indexing report for "Page with redirect" entries on old URLs, which is expected.

Planning a bigger move?

For domain changes or a move to a new host, build a spreadsheet mapping every old URL to its new one before you switch anything. Our guide to moving a website to a new host without downtime covers the wider process.

Wrapping up

A 301 redirect is a small instruction with a big job: keeping visitors and search engines on the right path when URLs change. Redirect permanently moved pages to their closest match, avoid chains and loops, update your internal links and keep redirects in place for the long haul. Do that, and URL changes won't cost you the traffic you've worked hard to earn.

Related reading: Does Web Hosting Affect SEO? 7 Ways Your Host Can Help or Hurt Rankings; The On-Page SEO Checklist: 20 Things to Check Before You Hit Publish.