405 Method Not Allowed
A 405 Method Not Allowed is oddly precise for an error. The address is right, the server is healthy, and it knows exactly what you asked for. It simply will not accept that verb on that URL. Something posted where only a read was allowed, and the server said so rather than guessing what you meant.
Updated August 2026 · 7 min read
-
Written by
Andrian Valeanu
Founder of Pulsetic
Andrian Valeanu founded Pulsetic and, before it, Designmodo. Across 15-plus years he has shipped web products, design tools, and monitoring software teams around the world rely on.
-
Reviewed by
Ionut Caval
Technical reviewer
Ionut Caval reviews Pulsetic's technical guides for accuracy. He works hands-on with web servers, networking, and uptime monitoring day to day, and makes sure the causes and fixes here hold up in production.
The short version: Run curl -i against the URL and read the Allow header the 405 is required to include. It lists the methods that URL accepts. Then either send one of those, or add the method you need to the route. On IIS, remove the WebDAV module, which claims PUT and DELETE before your app sees them.
Key takeaways
- 405 Method Not Allowed means the resource exists and the server knows the HTTP method, but that method is not permitted on that URL. A
POSTto a route defined only forGETis the everyday version. - RFC 9110 requires the response to carry an
Allowheader listing the methods the resource does accept, so a singlecurl -iusually tells you the answer outright rather than leaving you to guess. - This is a routing and configuration error far more often than an application bug. The URL is right, the method is wrong, or the server layer in front of your code refuses the verb before it arrives.
- Two setups produce most of the surprising cases: IIS, where the WebDAV module claims
PUTandDELETEbefore your app sees them, and CORS preflight, where an unhandledOPTIONSrequest gets a 405 and blocks the real one. - A 405 is a normal HTTP response, so the server looks healthy from outside. An up-or-down check will call the website up while a form or API endpoint quietly rejects every write.
- Error type
- HTTP 4xx client error
- Whose side
- Usually the request; sometimes the server config
- Fix difficulty
- Easy to moderate
- Common cause
- The URL does not accept that HTTP method
How did you find out this time?
Pulsetic is website uptime monitoring. It checks your URL from outside your network as often as every 30 seconds, confirms any failure from another region, then emails you.
10 monitors free, email alerts on failure and recovery. No credit card.
What does 405 Method Not Allowed mean?
A 405 Method Not Allowed is an HTTP status code in the 4xx family, which places the problem in the request rather than in a server failure. It has a narrow and useful meaning: the resource at that URL exists, the server recognises the method you used, and the method is not permitted on that particular resource. Per RFC 9110 the server must also return an Allow header listing the methods that are permitted, which makes 405 one of the few errors that tells you the fix in the response itself. The distinction from a 404 matters. A 404 says nothing lives at that address. A 405 says something does, you just asked for the wrong operation on it.
In practice this is a routing or configuration error rather than a bug in your application logic. A form posts to a URL that was only ever set up to serve a page. An API route is registered for GET and the client sends POST. A reverse proxy or a server module refuses the verb before it ever reaches your code, which is what happens on IIS, where the WebDAV module claims PUT and DELETE for itself. A browser sends an OPTIONS preflight the route never defined, and the 405 that comes back blocks the real request that would have followed.
- 405
- HTTP status code
- 4xx
- Client-side error class
- Allow
- Header the response must include
How the 405 Method Not Allowed error appears
The wording changes depending on your browser, device, or server. Here is how this error commonly shows up:
405
Method Not Allowed
The requested method is not allowed for this resource.
405 Method Not AllowedHTTP Error 405Error 405405 Not Allowed nginxHTTP 405.0 Method Not AllowedThe requested method is not allowed for this resource
405 vs 404, 403 and 501
Each of these refuses the request, but they disagree about what is actually wrong.
| Code | What it means | Who fixes it |
|---|---|---|
| 405 Method Not Allowed | The resource exists and the method is understood, but that method is not permitted here. The response names the methods that are. | Whoever sends the request, by using an allowed method, or the owner, by adding the verb to the route. |
| 404 Not Found | There is no resource at that URL at all, so no method would have worked. | The website owner, by restoring the resource, or the visitor, by correcting the address. |
| 403 Forbidden | The resource exists and the method is fine, but access is refused. Retrying with the same identity will not help. | The website owner, by fixing permissions, rules, or the firewall. |
| 501 Not Implemented | The server does not support that method anywhere, not just on this URL. | Whoever sends the request, by using a standard method the server implements. |
Which 4xx code fits which failure
These four all mean the request will not be processed, but they fail for different reasons and are fixed by different people.
| Code | What went wrong | What to change |
|---|---|---|
405 Method Not Allowed | The URL is right, the verb is not permitted there | Use a method from the Allow header, or add the verb to the route |
404 Not Found | No resource at that URL at all | Correct the path, or restore the resource |
501 Not Implemented | The server does not support that method anywhere | Use a standard method the server implements |
403 Forbidden | The method is allowed, but you may not use it | Fix permissions, auth, or the firewall rule |
What causes 405 Method Not Allowed?
- A form or client sends
POSTto a URL whose route is defined only forGET. This is the most common cause by a wide margin, and the form'sactionattribute is usually where it starts. - An API route registered for the wrong verb, or a client calling
PUTwhere the endpoint expectsPATCH, so the path matches but the method does not. - IIS with the WebDAV module enabled, which intercepts
PUTandDELETEbefore the application sees them and answers 405 on its own. - A CORS preflight
OPTIONSrequest hitting a route that never defined a handler forOPTIONS, so the router rejects it and the real request is never sent. - An nginx
limit_exceptblock, an Apache<Limit>directive, or a WAF rule that permits only a subset of verbs on a path. - A redirect that changes the method. Some servers turn a redirected
POSTinto aGET, and a trailing-slash or HTTP-to-HTTPS hop is enough to trigger it. - Static hosting or a CDN serving a path as a file, where every method except
GETandHEADis refused by design.
How to find the cause fast
- Send the request with
curl -iand read theAllowheader on the 405. It names the permitted methods, which frequently ends the investigation on the spot. - Confirm which method the client is really sending. Browser devtools shows it on the network row, and a redirect between the request and the final URL can change it without you noticing.
- Try the same URL with
GET. If that works, the resource exists and the problem is genuinely the verb rather than the path. - Bypass the proxy or CDN and hit the origin directly. A 405 that disappears at the origin points at an edge rule or a server module rather than your application.
How 405 Method Not Allowed looks from the outside
A 405 is a normal HTTP response, so nothing about it looks like an outage from outside: the connection opens, TLS completes, and the reply comes back quickly with the wrong status code. A plain up-or-down ping will report the website up while every form submission and every API write is being refused. It is also asymmetric in a way that hides it, because the GET a monitor usually sends is the one method that still works. To catch this you need a check that exercises the method that matters and asserts the status code it expects, not just one that confirms the host answers.
To confirm the exact code a URL returns, or to re-test several at once after a fix, run them through the free bulk URL status checker.
How to fix 405 Method Not Allowed
If you are a visitor
- Reload the page and submit the form again from a fresh load rather than from a stale tab, in case the page was cached from an older version of the website.
- Try the action in an incognito window. If an extension is rewriting the request or the URL, that rules it in or out quickly.
- Check whether you followed a redirect or an old bookmark to reach the form. A saved URL can point at a path that no longer accepts submissions.
- If the page loads but every submission fails, the fault is on the website's side. There is no visitor-side fix for a route that refuses the method, so report it to the website owner.
If you run the website
- Read the
Allowheader your own server returns, then add the missing method to the route or point the client at the URL that already accepts it. - Check the form's
actionattribute. A form posting to the page it lives on, rather than to a handler, produces this error constantly. - On IIS, remove the WebDAV handler and the WebDAV module for the site, then confirm the handler mapping lists the verbs your API needs. This is the single most common cause of a REST API returning 405 only in production.
- On nginx, look for
limit_exceptin the relevant location block. On Apache, check<Limit>directives and.htaccessrules that restrict methods. - Handle
OPTIONSexplicitly on any route that browsers call cross-origin, and return the CORS headers from it, so preflight does not come back 405. - Use
307or308rather than301or302where a redirect must preserve the method, since the older codes allow a client to turnPOSTintoGET. - Make sure your 405 responses actually include the
Allowheader. The specification requires it, and omitting it makes every future report of this error harder to diagnose.
Still not fixed? Next steps
- Run
curl -iagainst the URL and read theAllowheader on the 405. It names the methods the resource accepts, which usually turns the whole question into a one-line answer. - Compare the method your client actually sends with the one the route defines. Frameworks are strict here: a route registered for
GETwill not answerPOST, and a redirect between them can silently change the verb. - On IIS, remove the WebDAV handler and module for the site. It intercepts
PUTandDELETEahead of your application and is the usual reason an API that works locally returns 405 in production. - On nginx, look for a
limit_exceptblock or a location that only proxies certain methods. On Apache, check<Limit>directives and any.htaccessrule that restricts verbs. - If the 405 is on
OPTIONS, treat it as a CORS preflight problem rather than a method problem: handleOPTIONSon that route and return the CORS headers.
Code & configuration
Copy-paste starting points. Replace example.com and the paths with your own, and test changes on staging before production.
Read the Allow header the 405 is required to send
# -i prints the response headers alongside the status
curl -i -X POST https://example.com/article/1
# HTTP/1.1 405 Method Not Allowed
# Allow: GET, HEAD, OPTIONS <- the methods this URL accepts
Remove WebDAV on IIS so PUT and DELETE reach your app
<!-- web.config, inside <system.webServer> -->
<handlers>
<remove name="WebDAV" />
</handlers>
<modules>
<remove name="WebDAVModule" />
</modules>
Restrict or allow methods deliberately in nginx
location /api/ {
# everything except GET and POST returns 405 here
limit_except GET POST { deny all; }
proxy_pass http://app;
}
# remove or widen this block if a valid verb is being refused
How to prevent 405 Method Not Allowed
A 405 on a form or an API endpoint is invisible to an ordinary uptime check, because the GET that a basic monitor sends is exactly the method that still works while every write is refused. Pulsetic checks your website and endpoints from multiple locations every 30 seconds and alerts you by email, SMS, voice call, Slack, Discord, Telegram, or webhook the moment a URL stops returning the status code you expect. It measures what a real client sees from outside, so a route that quietly stops accepting submissions does not stay quiet.
Learn how Pulsetic's uptime monitoring detects this from the outside, across 15+ locations.
Sources and further reading
The specifications and vendor documentation this guide is written from, plus deeper reading on the parts it only summarises.
Frequently asked questions
-
What does 405 Method Not Allowed actually mean?
It means the URL you requested exists and the server recognises the HTTP method you used, but that method is not permitted on that resource. Sending
POSTto a route that only answersGETis the everyday case. It is more specific than a 404, which would mean nothing exists at that address at all, and the response is required to include anAllowheader naming the methods the URL does accept. -
How do I find out which methods are allowed?
Read the
Allowheader on the 405 response, which RFC 9110 requires the server to send.curl -i https://example.com/pathprints it alongside the status line. You can also send an explicitOPTIONSrequest, which is defined to report the methods a resource supports, although some servers do not implement it as carefully as they should. -
Why does my API return 405 in production but work locally?
The usual answer is a server layer that only exists in production. IIS with the WebDAV module enabled intercepts
PUTandDELETEbefore your application runs and answers 405 itself, which is why this is so common on Windows hosts. A reverse proxy, CDN, or WAF that only forwards a subset of verbs does the same thing. Hit the origin directly, bypassing the edge, and if the request succeeds there you have found the layer responsible. -
Why do I get a 405 on an OPTIONS request I never sent?
The browser sent it for you. Certain cross-origin requests trigger a CORS preflight, an automatic
OPTIONSrequest that asks the server whether the real request is allowed. If your route never defined anOPTIONShandler, the router answers 405 and the browser abandons the actual request. HandleOPTIONSon that route and return the CORS headers from it. -
Is a 405 the same as a 403?
No. A 403 Forbidden means the method was acceptable but you are not allowed to perform it, so it is about identity and permission. A 405 means the method itself is not permitted on that resource, regardless of who you are. Logging in or presenting a different token will clear some 403s. It will never clear a 405, because the route simply does not answer that verb.
-
Does a 405 hurt SEO?
Not directly, because search engines crawl with
GETandHEAD, and a URL returning 405 to those is unusual. Where it does matter is if a misconfiguration makes ordinary page requests return 405 instead of 200, in which case those pages cannot be crawled or indexed at all. Confirm that the URLs you want indexed answerGETwith a 200 and that no proxy or WAF rule is refusing the verb at the edge. -
Can a redirect cause a 405?
Yes, and it is an easy one to miss. When a
POSTis answered with a301or302, clients are permitted to reissue it as aGET, and the destination may then reject that verb. A trailing-slash normalisation or an HTTP-to-HTTPS hop is enough to set it off. Use307or308where the method must be preserved across the redirect. -
What is the difference between 405 Method Not Allowed and 501 Not Implemented?
The difference is whether the server knows the method at all. A 405 says the server understands the method perfectly well and supports it elsewhere, it just will not accept it on this particular URL:
POST /article/1when that route only answersGET. A 501 is broader, the server does not implement that method anywhere, for any resource. In practice 405 is the one you meet, because it comes from routing, and 501 usually means an exotic verb hit a server that was never built to handle it. -
Why does my form return 405 when I submit it but the page loads fine?
Because loading the page is a
GETand submitting it is aPOST, and only the first one is allowed on that URL. The form is posting somewhere that was only ever set up to serve a page. Check the form'sactionattribute, which may be pointing at the page itself instead of a handler, and check that the route or handler for that path actually acceptsPOST. A trailing-slash redirect can do it too: some servers turn a redirected POST into a GET, and the destination then rejects it. -
Why do I get a 405 on OPTIONS requests from the browser?
That is a CORS preflight. Before certain cross-origin requests, the browser sends an
OPTIONSrequest on its own, and plenty of servers and frameworks never define a handler for it, so the router answers 405 and the real request never happens. The fix is to letOPTIONSthrough on that route and return the CORS headers, rather than to loosen anything on the actualPOSTorPUT. -
Does a 405 response have to tell me which methods are allowed?
Yes. RFC 9110 requires a 405 to include an
Allowheader listing the methods the resource does support. That makes it one of the more helpful errors to debug: runcurl -iand read the header rather than guessing. When theAllowheader is missing, the server or framework is not following the specification, and that omission is itself worth fixing. -
Why did a 405 appear on IIS only for PUT and DELETE?
IIS ships with the WebDAV module enabled, and it claims
PUTandDELETEfor itself before your application ever sees them, answering 405. It is the classic cause of a REST API that works locally and returns 405 on a Windows host. Remove the WebDAV handler and module for the site, then confirm your own handler mapping actually lists the verbs you need.
Trusted by teams at companies around the world
-
Catch the next outage before your visitors do.
2-minute setup · Cancel any time
-
No credit card needed