What 501 means
The server doesn't support the functionality the request needs. In practice that almost always means it doesn't recognize the request method at all. RFC 9110 §15.6.2 defines it, and says 501 is the right answer when the server doesn't recognize the method "for any resource". It's one of the few error codes that is cacheable by default, so a proxy may store the answer.
HTTP/1.1 501 Not Implemented
Content-Type: text/plain
Content-Length: 34
Method PURGE is not implemented.
The key difference from 405 Method Not Allowed: 405 means the server knows the method but this resource doesn't allow it (and the response must carry an Allow header listing the methods that work). 501 means the server has no idea what the method is anywhere. General-purpose servers are required to support GET and HEAD, so a 501 for those points at something very unusual in between.
Common causes
- Custom or extension methods such as
PURGE,BAN,PROPFINDorMKCOLsent to a server without the module that handles them (a cache, WebDAV). - A typo in the method, for example from a script that builds the request line itself.
- An unsupported
Transfer-Encodingin the request: some servers answer 501 when they can't decode the body's encoding. - Older proxies or embedded servers that only implement
GET,HEADandPOSTand rejectPUT,PATCHorDELETE. - APIs that use 501 for "not built yet" endpoints. That's a loose reading of the spec, but you will meet it.
How to fix it
As a client:
- Check the method name and spelling, and whether the API documents it.
- If the method works directly against the application but not through a proxy, CDN or load balancer, the middle box is answering. Compare the response's
ServerandViaheaders. - For cache purges, use the provider's API rather than a raw
PURGErequest, unless you configured the cache to accept it.
As a server:
- Enable the module the method needs (WebDAV in Apache with
mod_dav,ngx_http_dav_modulein nginx; aPURGEhandler in Varnish VCL). - For a known method that a route doesn't accept, return 405 with an
Allowheader instead of 501. - In APIs, prefer 404 for routes that don't exist and 405 for wrong methods; keep 501 for genuinely unrecognized methods.
501 and SEO
Crawlers fetch pages with GET and HEAD, so a 501 normally never reaches them. If one does, Google treats it like any other 5xx: crawling slows down, and URLs that keep failing are eventually dropped. A 501 on a normal page fetch usually means a firewall or proxy rule is rejecting requests it shouldn't.
Related codes
- 405 Method Not Allowed: the method is known but not allowed here.
- 500 Internal Server Error: a generic server failure.
- 400 Bad Request: the request itself is malformed.
- 505 HTTP Version Not Supported: the HTTP version, not the method, is the problem.
Try other methods against the same URL with the HTTP Request Builder to see which ones the server accepts.