tags:

views:

25

answers:

1

I have a rewrite rule for GET and POST:

<LocationMatch "^/my/script/dir/?$">
    RewriteEngine on
    RewriteCond %{REQUEST_METHOD} ^(HEAD|GET)$


    RewriteRule .* /resources/scripts/storage/admin/list.php


    Script POST /resources/scripts/storage/admin/create.php
</LocationMatch>

How would I modify it to only allow POST?

+1  A: 

50% confidence on this:

replace

RewriteCond %{REQUEST_METHOD} ^(HEAD|GET)$

with

RewriteCond %{REQUEST_METHOD} ^POST$

don't forget:

^ has two purposes, when used inside of [ ] it designates 'not'. (EG [^0-9] would match any character that is not 0 to 9 and [^abc] would match any character that is not a lowercase a, b, or c.) When used at the beginning of a pattern in mod_rewrite, it also designates the begining of a 'line'.

Zak