--- title: "405 Method Not Allowed — what it means and how to fix it" description: "The URL exists, but it does not accept the HTTP method you used. What causes an HTTP 405, what to try as a visitor, and what to check if it is your own site." url: https://atoneplace.net/error/405/ site: "At One Place" --- # HTTP 405 — Method Not Allowed **HTTP 405: Method Not Allowed** The URL exists, but it does not accept the HTTP method you used. ## What 405 actually means The resource is real; the verb is wrong. Sending POST to an endpoint that only reads, or DELETE to something the server will not let you remove, produces a 405. The response must include an `Allow` header listing the methods that are accepted, which makes this one of the more diagnosable errors — if the header is there, it tells you exactly what to send instead. ## Common causes - A POST sent to a route defined only for GET, or vice versa - A form with the wrong `method` attribute - PUT, PATCH or DELETE disabled at the web server or WAF level - A trailing-slash redirect converting a POST into a GET, so the POST route never sees it - An OPTIONS preflight blocked by server configuration, breaking CORS ## If you're just trying to view the page 1. Rarely anything you can fix — this is a mismatch between the site's code and the request it made 2. Go back and use the site's own links or buttons rather than a saved or edited URL 3. Report it to the site owner; a 405 on a normal page is a genuine bug on their end ## If it's your site 1. Send the `Allow` header — it is required, and without it the client cannot tell what to do 2. Check the route definition for the method you meant to register 3. Look for redirects between the client and the handler: a 301 from `/path` to `/path/` will turn a POST into a GET in most browsers, so use 307 or 308 if it must survive 4. Verify that WebDAV methods or PUT/DELETE are not blocked by a module or a security policy 5. Handle OPTIONS explicitly for CORS endpoints rather than letting the framework reject it ## Reference - **Status code:** 405 - **Reason phrase:** Method Not Allowed - **Category:** 4xx — Client Error - **Cacheable by default:** Yes - **Defined in:** RFC 9110 §15.5.6 ## Common questions ### What does HTTP 405 mean? The URL exists, but it does not accept the HTTP method you used. The resource is real; the verb is wrong. Sending POST to an endpoint that only reads, or DELETE to something the server will not let you remove, produces a 405. ### How do I fix a 405 error? Rarely anything you can fix — this is a mismatch between the site's code and the request it made ### Is 405 a client error or a server error? 405 is in the 4xx range, which means client error. The request itself was the problem, so retrying it unchanged will usually return the same code. ## Related pages - [404 Not Found](https://atoneplace.net/error/404/) - [403 Forbidden](https://atoneplace.net/error/403/) - [401 Unauthorized](https://atoneplace.net/error/401/) - [429 Too Many Requests](https://atoneplace.net/error/429/) - [400 Bad Request](https://atoneplace.net/error/400/) - [413 Content Too Large](https://atoneplace.net/error/413/) - [422 Unprocessable Content](https://atoneplace.net/error/422/) - [409 Conflict](https://atoneplace.net/error/409/) - [415 Unsupported Media Type](https://atoneplace.net/error/415/) - [408 Request Timeout](https://atoneplace.net/error/408/) - [410 Gone](https://atoneplace.net/error/410/) - [451 Unavailable For Legal Reasons](https://atoneplace.net/error/451/) ## Sources - Hypertext Transfer Protocol (HTTP) Status Code Registry — IANA (https://www.iana.org/assignments/http-status-codes/) - RFC 9110: HTTP Semantics — IETF (https://www.rfc-editor.org/rfc/rfc9110.html)