IPv4
From $0.72 for 1 pc. 40 countries to choose from, rental period from 7 days.
IPv4
From $0.72 for 1 pc. 40 countries to choose from, rental period from 7 days.
IPv4
From $0.72 for 1 pc. 40 countries to choose from, rental period from 7 days.
IPv6
From $0.07 for 1 pc. 14 countries to choose from, rental period from 7 days.
ISP
From $1.35 for 1 pc. 24 countries to choose from, rental period from 7 days.
Mobile
From $14 for 1 pc. 20 countries to choose from, rental period from 2 days.
Resident
From $0.70 for 1 GB. 200+ countries to choose from, rental period from 30 days.
Use cases:
Use cases:
Tools:
Company:
About Us:
Among all HTTP responses, the 405 error is one of the most common during API integrations, form wiring, and custom routing. It’s especially relevant for anyone working with server-side requests: developers, integrators, and technical specialists. The problem occurs when the web server software receives a syntactically valid request, but the method used is not allowed for the specific resource – for example, a POST instead of an allowed GET.
This article explains what the 405 error code means, the typical causes behind it, and how to fix it in different contexts – from a client request to server configuration.
A 405 error is returned when a web server receives a valid request but rejects it because the HTTP method is not permitted. The resource exists and the path is correct, but the action – such as TRACE (debugging) or DELETE (removing a resource) – is disallowed for that route.
The server includes an Allow header indicating which methods are permitted for the resource. It won’t show up on the page, but you can see it:
Example header:
Allow: GET, HEAD
This response is produced by configuration or application logs and routing rules. It’s often used to protect interfaces, restrict APIs, or filter actions according to predefined logic.
When troubleshooting, keep in mind that a 405 can be triggered at multiple layers – from server settings to intermediary filters. Pinpoint where the request was blocked before you start changing things.
The client uses a request method that the target resource doesn’t accept. For instance, sending POST (data submission) instead of allowing GET (data retrieval). This often happens when wiring HTML forms, writing API calls, or using nonstandard libraries.
NGINX, LiteSpeed, Caddy, or Apache can be configured to block specific HTTP request types for certain directories or files. These restrictions are defined at the configuration level and enforced by access policies for routes.
A Web Application Firewall (WAF) may block methods like PUT, DELETE, or OPTIONS as potentially risky. This is common on managed hosting, especially with cloud solutions or services that ship with traffic filters enabled.
Some APIs only support specific HTTP request types. Using an unsupported one results in a 405 error Method Not Allowed response. For example, calling PUT where only POST is permitted. This is typical with REST interfaces.
In CMSs and frameworks, failures often appear after installing a WordPress plugin that affects routing or security. For example, WordPress may restrict PUT and DELETE under certain configurations.
If the server or an intermediary (e.g., .htaccess or middleware) performs a redirect without preserving the original request type (turning POST into GET), the new request may be rejected. This is especially common when switching between HTTP and HTTPS, or normalizing trailing slashes.
A reverse proxy is an intermediary that receives client HTTP requests and forwards them to the application, possibly applying caching, compression, or filtering (e.g., NGINX, HAProxy, Cloudflare).
A CDN distributes content across geographically close edge locations. Many CDNs provide security and filtering features, including method restrictions.
If PUT, DELETE, or PATCH are blocked in the proxy or CDN configuration, the request can be rejected before it ever reaches your app, resulting in a 405.
Frameworks and libraries can return a HTTP error 405 when a route exists but has no handler for the current request type. For example, /data is configured for GET only, but the client sends POST. This is common in REST frameworks with explicit routing.
The fix depends on the layer where the rejection occurs:
Accurately identifying the layer lets you go straight to the relevant settings and avoid unnecessary debugging.
Symptoms: After submitting a form, calling an API, or running a script, the page doesn’t perform the expected action. The browser may show a 405 error despite a correct URL.
What to do:
Example: If an HTML form uses method="PUT" but the server accepts only POST, change PUT to POST.
On the client side, the issue may persist due to browser behavior or extensions. Testing another browser and disabling filters/plugins helps rule out client-side interference.
Symptoms: Some actions don’t work even though the rest of the site behaves normally – for instance, a form won’t submit while pages load fine. The server might display a default placeholder page.
How to fix:
Example: If .htaccess contains <Limit POST> that blocks POST, remove it or change to <LimitExcept POST>.
Symptoms: Certain forms or API calls return a 405 error that resubmitting doesn’t fix, while other site features work fine.
Steps:
Example: In Cloudflare, disable a rule that blocks PUT, or add /api/upload to an allowlist.
Symptoms: When working with an API, a request to a valid endpoint returns a 405, while other calls to the same resource succeed.
What to do:
Example: If only GET is allowed for /api/data but your script runs fetch('/api/data', { method: 'POST' }), change POST to GET.
Symptoms: After installing or updating an extension, clicking a button no longer triggers the expected action—the page remains unchanged.
What to do:
Example: In WordPress, after installing a “Security XYZ” plugin, a form stops working. Disabling that plugin restores functionality.
Note: In a CMS, also confirm the issue isn’t due to database table availability. If needed, use phpMyAdmin to diagnose with CHECK TABLE or the builtin “check/repair” option.
Symptoms: After a new page loads, interactions stop working: a form never submits, an action isn’t processed, and clicking a button has no effect.
Steps:
Example: If NGINX has return 301 /new-url; and the original request was POST, the redirect will turn it into GET. Use 307 to preserve POST.
Symptoms: Some actions fail: the page loads, but clicking a button or submitting data has no effect.
How to fix:
Example: If the site uses Cloudflare, go to Security → WAF → Tools and check for 405 error messages, then add a rule that allows PATCH for all paths starting with /api/.
Symptoms: The page loads, but interactive actions – such as submitting a form or clicking a button – don’t produce the expected result.
How to fix:
Example (Express.js): If only app.get('/login', ...) exists but the form submits POST, add:
app.post('/login', (req, res) => { /* login logic */ });
To avoid 405 errors, account for method restrictions and correctly configure the web server, application, and intermediaries.
Layer | What to Do |
---|---|
Client (browser, script) | Use allowed HTTP methods in forms and requests. Follow API documentation. |
Application | Ensure routes/controllers handle all methods you use (e.g., POST, PUT, DELETE as applicable). |
Web Server | Review .htaccess, nginx.conf, web.config — avoid unnecessary restrictions. |
WAF & Proxy/CDN | Allow PUT, PATCH, DELETE, etc., in filtering policies. Exclude required routes from blocks. |
CMS | Verify plugin/theme compatibility with nonstandard methods. Disable or replace conflicting extensions. |
HTTP 405 error is not a sign of a system-wide failure; it’s a signal that the request method doesn’t match what the server or application expects. To fix it, determine where the block occurs and adjust the configuration. The earlier these nuances are considered during development or setup, the more stable your web application will be.
Yes. For example, during server configuration changes or CMS plugin updates. In that case, resolve the conflict or roll back the settings.
A 405 means the path exists but the method is not allowed. A 403 indicates access is forbidden. A 404 means the resource doesn’t exist.
Indirectly, yes. Some extensions or browser caches can modify or rewrite methods – especially during redirects or when a form uses nonstandard attributes.
No. Some services block PATCH, PUT, and DELETE by default. Review filtering and security settings for each service you use.