Only allow GET request with htaccess

.htaccessapache-2.2

How should I allow only GET request to access all the files and script from my server using htaccess?

My web server is Apache

Best Answer

You may also want to have a look at the Apache Limit and/or LimitExcept directives. Rewrite rules give you the opportunity to put up a custom error page though.

I believe something like this might work:

<LimitExcept GET HEAD>
  Order Allow,Deny
  Deny from all
</LimitExcept>