Skip to content

3xx Redirection

301 Moved Permanently

The resource has a new permanent URL.

What 301 means

The URL in the Location header replaces the old one for good. Browsers and search engines update their links. Clients may change a POST into a GET when following it; use 308 to prevent that.

Common causes

  • The API or site moved (http → https, a new domain or a new path).

How to fix it

If you're calling an API

  • Update your code to the new URL. Follow redirects (curl -L) in the meantime.

If you run the server

  • Use 308 instead for API endpoints that receive POST, PUT or PATCH.

Should you retry?

Request the new URL from Location.

Example response

HTTP
HTTP/1.1 301 Moved Permanently
Location: https://api.example.com/v2/items

Related headers: Location.

Defined in: RFC 9110 (HTTP Semantics). 301 is a redirection.

Often confused with

HTTP 301 FAQ

What does HTTP 301 mean?

301 Moved Permanently: The resource has a new permanent URL. The URL in the Location header replaces the old one for good. Browsers and search engines update their links. Clients may change a POST into a GET when following it; use 308 to prevent that.

Is 301 a client or server error?

Neither: 301 is a redirection response (3xx). Further action (usually following a new URL) is needed.

How do I fix a 301 error?

Update your code to the new URL. Follow redirects (curl -L) in the meantime.

Should I retry after a 301?

Request the new URL from Location.

Other 3xx status codes

All HTTP status codes