Discussion:
Restrict GET but Allow HEAD - on Apache (Fedora Core 19)
(too old to reply)
t***@gmail.com
2014-11-02 15:15:41 UTC
Permalink
Hello All,

I want to similuate a scenario on Apache where I have a file inside a folder (example: http://www.mysite.com/folder1/abc.php) and I want to restrict GET method (should generate 401) but allow HEAD method.

Any pointers?

Thanks in advance.
Kees Nuyt
2014-11-03 14:20:36 UTC
Permalink
Post by t***@gmail.com
Hello All,
I want to similuate a scenario on Apache where
http://www.mysite.com/folder1/abc.php) and I want
to restrict GET method (should generate 401) but
allow HEAD method.
Any pointers?
Perhaps the Limit and LimitExcept directives are what you are
looking for:

http://httpd.apache.org/docs/2.4/mod/core.html#limit

, but it appears to handle GET and HEAD in the same way, so it
might take some experimentation to make it do what you want.

An alternative would be to have the abc.php script to evaluate the
method, and return 401 on 'GET'.
Post by t***@gmail.com
Thanks in advance.
Hope this helps
--
Kees Nuyt
Loading...