Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I disallow POST requests on a certain page of the website?

Like disallow POST on

but allow it on subpages, like or

The problem is an old script that was handling such requests. This script is now inactive, however such requests still come, and burden the server. I want to somehow block them

share|improve this question

It is not recommended to use the <Limit> directive for access control in most cases, but in your situation this may be your best option:


  <Location /post.php>
    <Limit POST>
      Order deny,allow
      Deny from all

The code above will return 403 Forbidden for POST requests for More information about the Limit directive.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.