← Back to all posts How-to

301 Redirects: When to use them, when to avoid them, and how to set them up

May 25, 2026·8 min read

A 301 redirect tells browsers and search engines: "This page has moved permanently. Here's where to find it now." Done right, you preserve your traffic and ranking. Done wrong, you create redirect chains, infinite loops, and slow page loads. Here's what to actually do.

What a 301 actually is

HTTP status code 301 means Moved Permanently. When a browser or crawler hits a URL that returns a 301, it gets an instruction: "stop looking here, go to this other URL instead, and update your records."

For SEO, the important word is permanently. Search engines treat a 301 as a signal to transfer your old URL's ranking power, backlinks, and indexed status to the new URL. Over the following weeks, search engines remove the old URL from their index and replace it with the new one.

301 vs 302 vs other redirect types

In 95% of real-world cases, the answer is a 301. Use 302 only when you genuinely mean "this is temporary."

When you should use a 301

When NOT to use a 301

Don't redirect to the homepage

If you delete /blue-widgets, redirecting it to your homepage tells search engines "this page is the homepage now", which is wrong. Search engines often treat homepage redirects as soft 404s. Redirect to the most relevant existing page (e.g. /widgets) or return a clean 404 if no equivalent exists.

Where you set them up

Where the redirect lives depends on what runs your site:

Copy-paste rules for each platform

Apache .htaccess

RewriteEngine On
Redirect 301 /about-us /about
Redirect 301 /blog/old-slug /blog/new-slug

nginx

server {
  location = /about-us { return 301 /about; }
  location = /blog/old-slug { return 301 /blog/new-slug; }
}

Netlify / Cloudflare Pages _redirects

/about-us       /about            301
/blog/old-slug  /blog/new-slug    301

Cloudflare Workers

const REDIRECTS = new Map([
  ["/about-us", "/about"],
  ["/blog/old-slug", "/blog/new-slug"],
]);
export default {
  async fetch(request) {
    const url = new URL(request.url);
    const target = REDIRECTS.get(url.pathname);
    if (target) return Response.redirect(new URL(target, url), 301);
    return fetch(request);
  }
};

Generate redirect rules in 30 seconds

Paste your old → new URL pairs once. Get Apache, nginx, Cloudflare, and Netlify rules in one click.

Open the generator →

Common mistakes

How long does it take search engines to update?

Search engines recrawl high-traffic pages within hours and low-traffic pages within weeks. For most sites, the new URL starts appearing in search results within 1–4 weeks of setting up the 301. The old URL drops out of the index over the same window.

To speed things up, submit the new URL via search-engine webmaster tools → URL Inspection → Request Indexing. This nudges search engines to check the new URL sooner.

Related reading