I'm trying to set up and API for a database I maintain through CakePHP. So far I only need access to a single action on a single controller. I have managed to set up a new URL for the POST requests but the original URL still accepts these POSTs too.
Is there a way to stop the POST requests from being accepted by CakePHP unless it is send to the new URL? For example /contact/add is routed to /api/contact and should only accept POST requests there.
In your
routes.php
you can configure the routing ofcontact/add
toapi/add
As for the POST data, in your controller method just include something like the following: