I have a API made with CakePHP and I don't want to use the views to display something on the website, for example I'd like to be able to use api.mydomain.com/users in CURL, but if I try to go to the URL in my browser I want it to redirect to api.mydomain.com which will be my API documentation. I want this to be for every controller.
I don't know if my question is clear, but I only want my site to serve JSON responses and nothing else. If there's a better solution to my question, I'd like to hear it too.
Thanks for helping.