HTTP status code lookup

301 Moved Permanently: Meaning, SEO and Examples

A 301 Moved Permanently response tells the client that the resource has a new, permanent URL, given in the Location header. Browsers follow it automatically and remember it, and search engines move the old URL's ranking signals to the new one.

Use it when a page has moved for good: a new domain, HTTP to HTTPS, a renamed URL or two pages merged into one.

301

Moved Permanently

The resource has a new permanent URL, given in the Location header. Browsers and search engines update to the new URL.

Look up any other status code →

What a 301 response looks like

Browsers cache a 301, often with no expiry, so a mistaken 301 is hard to take back. If you're not sure the move is final, test with a 302 first.

HTTP/1.1 301 Moved Permanently
Location: https://www.example.com/new-page

Set up a 301 redirect

SetupRedirect
nginxreturn 301 https://www.example.com$request_uri;
Apache (.htaccess)Redirect 301 /old-page /new-page
Expressres.redirect(301, "/new-page")
PHPheader("Location: /new-page", true, 301);
Next.js{ source: "/old-page", destination: "/new-page", permanent: true } in redirects(). Next.js sends 308 for this, which search engines treat like 301.

301 redirects and SEO

  • Google treats a 301 or 308 as a strong signal that the new URL should be the one it shows in results.
  • Redirect each old URL to the page that replaces it. Sending everything to the homepage can be treated as a soft 404.
  • Point redirects straight at the final URL. Chains such as http → https → www → new page add a request each and can stop crawlers before the end.
  • Update internal links, canonical tags and the sitemap to the new URL, so the redirect is only a fallback.
  • Keep redirects for a moved site in place for at least a year.

Frequently asked questions

What is the difference between 301 and 308?

Both are permanent. With 301 a client may turn a POST into a GET when it follows the redirect; with 308 it must repeat the same method and body. For ordinary pages either works; for API endpoints that receive POST, use 308.

How do I check whether a URL returns a 301?

Run curl -I https://example.com/old-page. The first line shows the status, and the Location header shows where it points. Add -L to follow the whole chain.

Does a 301 redirect lose ranking?

Google has said that permanent redirects don't lose PageRank. Rankings can still move for a while as Google recrawls the old and new URLs and combines their signals.

More http status code lookup guides

Open the full http status code lookup →

From the blog