file_get_contents(‘php://input’) blank, empty, nada, zilch, kaput, null, where’s my data?

If you’re pulling out your hair about why you can’t process posted payload data to your php script you may be getting 301 redirected by Apache even though you didn’t ask it to. Try this in your .htaccess:

DirectorySlash Off
RewriteRule ^(nameOfDirectoryYoureTryingToGet|another|another)$ $1/index.php

The first line stops the redirect, but, depending on your host, you may find it just causes a “forbidden” error, so the second line rewrites you down to the index within the folder. This is useful for API endpoints.

Enjoy.