The resource has a new URL, given in the Location header, and clients should use it from now on.
Defined in RFC 9110 §15.4.2 — 301 Moved Permanently · MDN reference
Domain moves, HTTPS upgrades, trailing-slash normalisation, and any URL you want search engines to forget in favour of a new one.
Check whether your client follows the redirect, and whether it preserves the method and body when it does — many libraries silently turn a redirected POST into a GET.
Follow the Location header, and update anything you have stored — the whole point of "permanently" is that the old URL should not be requested again. Note that many clients historically rewrite the method to GET when following a 301 after a POST; if the method must be preserved, the server should send 308.
1 endpoint in this playground answers with 301. Every one is free, needs no signup, and can be called from the browser or with curl.
GET https://funapi.dev/api/protocol/v1/moved/old-dashboard — Always. Follow the Location header — real HTTP clients do it automatically. (Protocol Lab API) Open & run this endpointAll HTTP status codes · All 39 mock REST APIs · Getting started guide
Last updated