Reputation: 190
I want apache to return a status code of 200 in response to post requests on a specific path
e.g. /api/mypath/foo
Is this possible with a RewriteRule?
Upvotes: 5
Views: 13643
Reputation: 190
I'm using nginx now This is how its done in nginx
location / {
return 200 '' ;
access_log off;
}
Upvotes: -3
Reputation: 41249
Try the following code in htaccess.
RewriteEngine on
RewriteCond %{THE_REQUEST} POST /api/mypath/foo [NC]
RewriteRule ^ - [R=200]
This will return the 200ok status for /api/mypath/foo if it is accessed using POST method.
Upvotes: 11