What Is a 301 Redirect? When to Use It and How to Set One Up

Discover what is a 301 redirect, when to use it, and how to set one up to improve your website's SEO and user experience effectively.

What Is a 301 Redirect? When to Use It and How to Set One Up

what is a 301 redirect | Updated October 2026 | 12 min read | hyperank Editorial Team

What is a 301 redirect? It's a server response with the HTTP status code 301 (Moved Permanently) that sends browsers and search engines from an old URL to a new one, and tells them the move is permanent. Google treats a 301 as a strong signal that the new URL should be indexed in place of the old one, which is why 301s are the standard way to keep traffic and search signals when you change a URL, merge pages or move domains. This guide, What Is a 301 Redirect? When to Use It and How to Set One Up, compares 301 with 302, 307 and 308, explains what happens to SEO signals, shows when to use one, and gives setup steps for Apache, Nginx, WordPress and Shopify, plus how to avoid chains and loops and how to check your redirects.

A 301 redirect is a forwarding address for a URL. Get it right and visitors, links and rankings follow the move; get it wrong and they hit a dead end.

What Is a 301 Redirect?

A 301 redirect is a permanent redirect from one URL to another, sent by the server as an HTTP 301 status code with a Location header pointing to the new address. When a browser requests the old URL, it immediately loads the new one; when a search engine crawls it, it updates its index to the new URL over time.

HTTP/1.1 301 Moved Permanently
Location: https://example.com/new-page/
  • Permanent: It says the old URL won't come back.
  • Server-side: It happens before any page content loads.
  • Search signal: Google's HTTP status code documentation says Google uses a 301 "as a strong signal that the redirect target should be processed."
  • Standardized: Redirect status codes are defined in the HTTP specification, RFC 9110.

Why it matters

Without a redirect, anyone following an old link or bookmark lands on a 404 error, and search engines eventually drop the old URL without passing its signals to the new one. A 301 keeps the journey intact for both people and crawlers.

301 vs 302, 307 and 308

The main difference between redirect types is whether the move is permanent or temporary, and whether the request method (such as a form POST) is preserved. For SEO, the permanent versus temporary distinction is what matters most.

CodeMeaningPermanent?Keeps request method?Google's treatment
301Moved PermanentlyYesNot guaranteed (POST may become GET)Strong signal the target is canonical
308Permanent RedirectYesYesTreated like a 301
302FoundNoNot guaranteedTarget not treated as canonical by the redirect alone
307Temporary RedirectNoYesTreated like a 302
  • Permanent moves: Use 301 or 308. According to Google's redirects guide, permanent redirects show the new target in search results.
  • Temporary moves: Use 302 or 307. Google says temporary redirects show the source page in results, and the indexing pipeline doesn't use them as a signal that the target should be canonical.
  • Method matters for apps: 307 and 308 guarantee the method and body are kept, which matters for forms and APIs more than for normal pages.

Other redirect types

Google's guide also lists meta refresh and JavaScript redirects. A 0-second meta refresh is treated as permanent, but server-side redirects have the highest chance of being interpreted correctly, and Google advises using JavaScript redirects only if you can't do server-side or meta refresh redirects.

What Happens to SEO Signals

When you 301 an old URL to a relevant new one, Google follows the redirect, processes the new page and, over time, treats the new URL as the canonical version. Links pointing at the old URL effectively point to the new one, so the new page can inherit the old page's standing.

  • Indexing: The old URL is gradually replaced by the new one in search results.
  • Links: Links to the old URL continue to help, because they lead to the new page.
  • Relevance matters: Redirecting to a closely matching page works best. Sending many unrelated pages to the homepage can be treated more like a soft 404.
  • Timing: Changes aren't instant; Google needs to recrawl the old URLs.
  • Keep redirects in place: Leave 301s live for at least a year, and ideally indefinitely, so links and bookmarks keep working.

Redirects and canonical tags work together

Redirects are one of several canonicalization signals. After a redirect, make sure the new page's canonical tag points to itself, internal links point to the new URL, and your sitemap lists only the new URL. See our guide to canonical URLs for more.

Key Takeaway: A 301 passes the baton to the new URL. Update your own links too, so you aren't relying on the redirect forever.

Do redirects slow pages down?

Each redirect adds a round trip before the final page loads, which is small for one hop but noticeable on mobile connections when hops stack up. That's another reason to keep redirects to a single hop and to update internal links so visitors and crawlers go straight to the final URL.

When to Use a 301 Redirect

Use a 301 whenever content has moved permanently to a new URL, or when two pages should become one. If the change might be reversed, use a 302 instead.

SituationUse a 301?Redirect to
Changing a page's URL or slugYesThe new URL
Merging two similar articlesYesThe combined page
Moving to a new domainYesThe matching page on the new domain
Switching from HTTP to HTTPSYesThe HTTPS version
Choosing www or non-wwwYesYour preferred version
Discontinued product with a close replacementYesThe replacement product or category
Temporary sale or maintenance pageNo, use 302The temporary page
Page removed with no replacementNoReturn 404 or 410

Discontinued products

For an ecommerce store, redirect a discontinued product to its direct replacement or the most relevant category. If nothing similar exists and the product won't return, a 404 or 410 with helpful navigation is often clearer for shoppers than an unrelated redirect.

Site migrations

For a domain move or redesign, build a redirect map that matches every old URL to its best new equivalent, one to one where possible. Google also recommends using the Change of Address tool in Search Console for domain moves.

Building a redirect map

Old URLNew URLReasonStatus
/blog/seo-tips-2024//blog/seo-tips/Evergreen URLTested
/products/blue-jacket-old//products/blue-jacket/Handle changeTested
/services/web-design-london//services/web-design/Pages mergedTo test

A simple spreadsheet like this, with one row per old URL, makes migrations manageable and gives you a checklist to test after launch. Start with pages that have the most traffic and backlinks.

Redirect or canonical tag?

Use a 301 when the old URL should no longer be visited. Use a canonical tag when both URLs need to stay accessible, such as filtered product pages or tracking parameters, but you want search engines to index only one. A redirect moves people; a canonical only advises search engines.

How to Set Up a 301 Redirect

How you set up a 301 depends on your server or platform. Test every rule on a staging site or with a single URL before rolling out site-wide.

Apache (.htaccess)

For a single page, add a line to your .htaccess file in the site root:

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

For pattern-based rules, use mod_rewrite:

RewriteEngine On
RewriteRule ^blog/old-slug/?$ /blog/new-slug/ [R=301,L]

To send all HTTP and non-www traffic to the HTTPS www version in a single hop on Apache, a common pattern is:

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

Replace example.com with your domain, and test with a few URLs before deploying.

Nginx

Inside the relevant server block, add a location rule, then reload Nginx:

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

WordPress

  • Redirect plugins: Plugins such as Redirection let you add 301s from the dashboard without editing server files.
  • SEO plugins: Some SEO plugins, such as Rank Math, include redirect managers.
  • Slug changes: WordPress may add some redirects automatically when you change a post slug, but don't rely on that for important pages.

Shopify

  • URL redirects: In the Shopify admin, add redirects under the online store's navigation settings in the URL redirects section, entering the old path and the new path.
  • Automatic option: When you change a product or page handle, Shopify offers to create a redirect from the old URL.
  • Bulk imports: Shopify supports importing redirects from a CSV file for larger changes.
PlatformWhere to add redirectsBest for
Apache.htaccess or server configFull control on traditional hosting
NginxServer block configurationHigh-traffic or custom servers
WordPressRedirect or SEO pluginNon-technical site owners
ShopifyAdmin URL redirects or CSV importStore owners

Common setup mistakes

  • Using 302 by default: Some plugins and hosts create temporary redirects unless you choose 301.
  • Relative paths in the wrong place: A missing slash or protocol can send users to the wrong URL.
  • Forgetting query strings: Decide whether parameters should carry over to the new URL.
  • Removing redirects too soon: Old links can keep arriving for years, so leave redirects in place long after a move.
  • No testing: Always request a few old URLs after deploying to confirm the status code and destination.

Redirect Chains and Loops

A redirect chain is when one URL redirects to another that redirects again, and a loop is when redirects send a URL back to itself. Both slow pages down, waste crawling, and can stop search engines from reaching the final page.

  • Chains: /a/ to /b/ to /c/ should be fixed so /a/ goes straight to /c/.
  • Crawler limits: Google's documentation says its crawlers follow up to 10 redirect hops by default; beyond that, the URL may not be processed.
  • Loops: /a/ to /b/ and /b/ back to /a/ causes browsers to show an error and search engines to give up.
  • Common cause: Layered rules for HTTPS, www and trailing slashes, each adding a hop.

How to fix them

ProblemExampleFix
Chain after a redesignOld URL to interim URL to final URLPoint the old URL directly to the final URL
Protocol and host hopshttp://example.com to https://example.com to https://www.example.comOne rule straight to the final version
LoopTwo rules redirecting to each otherRemove or correct one rule
Internal links to redirected URLsMenus linking to old pathsUpdate links to the final URL
Every extra hop is a small delay for users and a small risk for crawlers. One hop is the target.

How to Check a Redirect

Check redirects by requesting the old URL and confirming it returns a 301 and lands on the right final page in one hop. Do this after any change and periodically across the site.

  • Command line: Run curl -I https://example.com/old-page/ and check for "301 Moved Permanently" and the correct Location header.
  • Browser developer tools: The Network tab shows each redirect step and its status code.
  • Find broken links: The broken link checker finds links that lead to 404s, which often need redirects.
  • Check 404 pages: The 404 page checker confirms pages that should return a 404 actually do.
  • Search Console: URL Inspection shows the URL Google considers canonical after the redirect.

A redirect audit routine

WhenWhat to check
Before launchEvery row of the redirect map returns 301 to the right URL
Launch dayTop pages by traffic and links redirect in one hop
First monthSearch Console for crawl errors and indexing of new URLs
QuarterlyCrawl for chains, loops and internal links to redirected URLs

Redirects also affect AI search: AI crawlers and search-based assistants follow links to your pages too, so broken or looping redirects can stop them reaching content you want cited. hyperank tracks what ChatGPT, Perplexity, Gemini and other engines say about your brand, which helps you spot when moved pages stop being referenced.

301 Redirect FAQ

The most common questions are whether 301s hurt SEO, how long to keep them, and whether to redirect everything to the homepage. Short answers are below, with more in the full FAQ.

  • Hurt SEO? Not when they point to a relevant page.
  • How long? At least a year; ideally keep them indefinitely.
  • Homepage? No; redirect to the closest matching page.

Conclusion

A 301 redirect permanently forwards an old URL to a new one, and Google treats it as a strong signal to index the new address. Use 301s for permanent moves, merges and migrations, keep each redirect to a single hop pointing at a relevant page, and check them after every change.

Key Takeaways

  • Definition: HTTP 301 means Moved Permanently.
  • Permanent vs temporary: 301 and 308 for permanent moves; 302 and 307 for temporary ones.
  • SEO: Signals consolidate on the relevant new URL over time.
  • Setup: .htaccess, Nginx config, WordPress plugins or Shopify URL redirects.
  • Hygiene: Avoid chains and loops, and update internal links.

Find broken links that need redirects with the free broken link checker, and see what AI says about your brand with hyperank.

FAQ

What is a 301 redirect, when should you use it, and how do you set one up?

A 301 redirect is an HTTP response telling browsers and search engines that a URL has moved permanently to a new address. Use it when you change a URL, merge pages, move domains or switch to HTTPS. Set it up in Apache's .htaccess, an Nginx server block, a WordPress redirect plugin or Shopify's URL redirects, then check it returns a 301 and lands on the right page in one hop.

Does a 301 redirect hurt SEO?

No, when it points to a relevant page. Google uses it as a strong signal to index the new URL.

What is the difference between a 301 and a 302?

A 301 is permanent and shows the new URL in search; a 302 is temporary and Google keeps showing the original URL.

How long should I keep a 301 redirect?

At least a year, and ideally indefinitely, so old links and bookmarks keep working.

Should I redirect deleted pages to the homepage?

No. Redirect to a closely related page, or return a 404 or 410 if there's no replacement.

How many redirects can Google follow?

Google's crawlers follow up to 10 redirect hops by default, but you should aim for one.

Methodology: This article draws on Google Search Central's documentation on redirects and HTTP status codes, and RFC 9110. Server snippets are standard examples; test them in your own environment before deploying.

See where your brand stands

How six AI engines describe you, next to your competitors. About two minutes.

Check your brand free