Skip to content

Tag Archives: Apache

How to block HTTP requests for specific method

I needed to set my Apache Web Server to ignore/block all the HEAD requests but respond to GET requests normally. It is very simple with the mod_rewrite, for instance this can be added to .htaccess: RewriteEngine   On RewriteCond     %{REQUEST_METHOD} HEAD RewriteRule     ^.*$    – [F] Second line: RewriteCond     %{REQUEST_METHOD} HEAD matches all requests that use method [...]