Ads 468x60px

Pages

How To Block HTTP Requests For Specific Method

Set Apache Web Server To Ignore/Block All The HEAD Requests But Respond To GET Requests Normally. It Is Very Simple With The mod_rewrite, This Can Be Added To .htaccess:


Code:
RewriteEngine   On
RewriteCond     %{REQUEST_METHOD} HEAD
RewriteRule     ^.*$    - [F]
========>

Code:
RewriteCond     %{REQUEST_METHOD} HEAD
Matches All requests That Use Method HEAD.

Code:
RewriteRule     ^.*$    - [F]
It Tells Apache HTTP Not To Make Any Redirection And Sends Back HTTP 403 (FORBIDDEN).

0 comments:

Post a Comment