SiteError.comYour friendly guide to HTTP status codes
Status CodesBlog
  1. Home
  2. 3xx Redirection
  3. 301 Moved Permanently

301 Moved Permanently

📦
301
Moved Permanently
→

Example HTTP Response

HTTP Response
HTTP/1.1 301 Moved Permanently
Location: https://new-site.com/page
Common Causes
  • Website restructured with new URLs
  • Domain name changed
  • Page permanently relocated
Technical Details

What does this mean?

We've moved! Like forwarding your mail after moving to a new house. Update your bookmarks!

Technical Definition

The URL of the requested resource has been changed permanently. The new URL is given in the response.

RFC Says

"The 301 (Moved Permanently) status code indicates that the target resource has been assigned a new permanent URI and any future references to this resource ought to use one of the enclosed URIs."

Plain English:

The resource has permanently moved to a new address. Update your bookmarks and links - this is the new home forever. Search engines will transfer SEO value to the new URL.

"Note: For historical reasons, a user agent MAY change the request method from POST to GET for the subsequent request."

Plain English:

Important caveat: Due to old browser behavior, a POST request might become a GET request after following a 301 redirect. If you need to preserve the HTTP method (keep POST as POST), use 308 instead.

Common Misinterpretation

Many developers don't realize that 301 can change POST to GET. This is historical behavior from early HTTP implementations. Use 308 (Permanent Redirect) when method preservation matters, such as for API endpoints.

View RFC Documentation
Code Snippets

Ready-to-use code for returning this HTTP status in your application:

Node.js
// Express.js
app.get('/example', (req, res) => {
  res.status(301).json({
    error: 'Moved Permanently',
    message: 'Your error message here'
  });
});

// Native HTTP
const http = require('http');

http.createServer((req, res) => {
  res.writeHead(301, { 'Content-Type': 'application/json' });
  res.end(JSON.stringify({
    error: 'Moved Permanently',
    message: 'Your error message here'
  }));
}).listen(3000);
When to Use This Code
  • The resource URL has changed permanently and will never return
  • You want search engines to update their index to the new URL
  • Consolidating multiple URLs to a canonical URL for SEO
  • Note: May change POST/PUT requests to GET (use 308 to preserve method)
SEO Handling

Indexing

The old URL will be de-indexed and replaced by the new URL. Google passes most ranking signals (PageRank) to the destination URL.

Crawler Behavior

Crawlers follow the redirect to the new URL. Over time, they stop crawling the old URL and focus on the new one.

Canonical URL Notes

A 301 is treated as a strong canonical signal. The destination URL becomes the canonical version in Google's index.

Google Notes

Google recommends 301 for permanent URL changes. It may take time for the index to update, but the SEO value transfers eventually.

Google Search Documentation →
From the Blog
  • Understanding HTTP 301 Redirects: SEO, Migrations, and Common Pitfalls

    A comprehensive guide to HTTP 301 Moved Permanently — when to use it, how it affects SEO, implementation examples, and mistakes that can tank your rankings.

    7 min read
Related Status Codes
🔀302Found↪️307Temporary Redirect🏠308Permanent Redirect
Commonly Confused With
🔀302Found🏠308Permanent Redirect

301 Moved Permanently FAQ

What causes a 301 Moved Permanently error?

Website restructured with new URLs. Domain name changed. Page permanently relocated.

When should I use 301 Moved Permanently?

The resource URL has changed permanently and will never return. You want search engines to update their index to the new URL. Consolidating multiple URLs to a canonical URL for SEO. Note: May change POST/PUT requests to GET (use 308 to preserve method).

300 Multiple Choices302 Found

Popular Status Codes

  • 200 OK
  • 301 Moved Permanently
  • 302 Found
  • 400 Bad Request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
  • 500 Internal Server Error
  • 502 Bad Gateway
  • 503 Service Unavailable

Compare Codes

  • 401 vs 403
  • 301 vs 302
  • 404 vs 410
  • 500 vs 502
  • Compare any codes →

Categories

  • Informational
  • Success
  • Redirection
  • Client Error
  • Server Error
  • NGINX
  • Cloudflare
  • AWS ELB
  • Microsoft IIS

Tools

  • Cheat Sheet
  • Status Code Quiz
  • URL Checker
  • API Playground
  • Blog

© 2026 SiteError.com. All rights reserved.