HTTP 301 — Moved Permanently

This and all future requests should be directed to the given URI

When to use it

Use status 301 when this is the correct HTTP response semantic: This and all future requests should be directed to the given URI

Request and response example

GET /docs HTTP/1.1
Host: api.example.com

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

Related status codes

300, 302, 303, 304

References

MDN · RFC 9110