HTTP 301 · 3XX RFC 9110 §15.4.2 Cacheable: Yes (indefinitely in browsers) Retryable: Follow Location header

HTTP 301 Moved Permanently: Root Causes & Production Fix Guide

HTTP 301 Moved Permanently tells browsers and search engines a URL has permanently moved. Misconfigured 301 rules cause infinite HTTPS redirect loops, dropped POST payloads, and sticky browser caches.

Top Root Causes of HTTP 301

Nginx Canonical HTTPS + Non-WWW 301 Redirect

server {
    listen 80;
    server_name example.com www.example.com;
    return 301 https://example.com$request_uri;
}
server {
    listen 443 ssl http2;
    server_name www.example.com;
    return 301 https://example.com$request_uri;
}

Verify with cURL

curl -i -sS -L --max-redirs 5 http://www.example.com/

Interactive Stack Diagnoser (HTTP 301)

Frequently Asked Questions

How do I fix a Cloudflare 301 too many redirects loop?

Switch Cloudflare SSL/TLS mode from Flexible to Full (Strict) so Cloudflare connects to your origin over HTTPS instead of hitting your port 80 redirect.

Does 301 pass full SEO PageRank?

Yes. Google treats 301 and 308 permanent redirects as strong canonical signals and transfers link equity to the destination URL.

How do I avoid POST turning into GET on permanent redirects?

Use HTTP 308 Permanent Redirect instead of 301 for API endpoints that receive POST, PUT, or PATCH requests.

Related Status Guides & Header Tools