HTTPfy

301 Moved Permanently

The resource has moved permanently to the URL in the Location header.

301 at a glance

Code
301
Name
Moved Permanently
Class
3xx Redirection
Status
IANA-registered standard code
Defined in
RFC 9110, Section 15.4.2
Cacheable by default
Yes, heuristically cacheable (RFC 9110 section 15.1): without Cache-Control or Expires, caches may store it and pick a freshness lifetime themselves. Send explicit Cache-Control to stay in control.

What 301 means

301 Moved Permanently tells clients and search engines that the target URI has a new permanent address. Search engines transfer ranking signals to the new URL. Browsers cache 301s heuristically and often for a long time, so a mistaken 301 can stick in users' browsers. For historical reasons clients may change a POST into a GET when following a 301; use 308 when the method must be kept.

What typically causes a 301

  • HTTP to HTTPS redirects: nginx return 301 https://$host$request_uri;, Apache Redirect permanent, Cloudflare "Always Use HTTPS".
  • www to apex (or the reverse) canonicalisation.
  • Trailing-slash normalisation: nginx and Apache redirect /dir to /dir/ for directories.
  • Site migrations and URL restructures.

Fix it on the server

  • Redirect in one hop to the final URL; chains (http to https to www to path) waste time and crawl budget.
  • Test with a temporary 302 or 307 first. Once browsers cache a 301 you cannot easily take it back.
  • Use 308 for API endpoints that receive POST or PUT.

Fix it as a client or visitor

  • To see the hop chain, run curl -sIL https://example.com, or use the redirect checker linked on this page.
  • If a browser keeps redirecting after the server changed, clear the cache or test in a private window: the 301 is cached.

Headers that go with 301

HeaderRole
LocationThe new permanent URL.
Cache-ControlLimit how long the redirect is cached, e.g. max-age=3600.

Example response

HTTP/1.1 301 Moved Permanently
Location: https://www.example.com/new-path
Content-Length: 0
Cache-Control: max-age=86400

Opens the HTTP headers tool with your URL filled in; it shows the status line and headers of every redirect hop.

Checking a whole domain's redirects? The HTTP status checker follows http, https, www and non-www variants and shows every hop.