I am trying to build 'Clean' urls for my REST API.
In /test/index.php I have the following code:
<?php
var_dump($_POST);
I am using Postman to POST data here:
http://localhost:8888/test/index.php
It returns the following as expected:
array(1) {
["test"]=>
string(14) "1"
}
When I use Postman without index.php:
array(0) {
}
The data is dropped, even though it is hitting the index.php.
Now what is really strange is if I Post to:
array(1) {
["test"]=>
string(14) "1"
}
It works. I do not want the trailing slash.
Now to fix this I added this to my .htaccess:
RewriteRule test test/index.php [NC,P]
As has been suggested in this article:
Is it possible to redirect post data?
That still isn't working. What am I missing?