REST API URL parameters not working with apache server

The title pretty much says it all, if I try eg. /wp-json/wp/v2/posts?id=1, I get all the posts as response. URL parameters are not working as they should. According to the REST API Handbook, the server is not configured properly to detect URL parameters. There’s a common solution given for nginx servers, but I use apache, so I have no idea how to solve this.

1 Answer
1

You’re using the wrong endpoint. Look at the documentation. id is not one of the parameters for the posts endpoint.

The correct way to retrieve a post with the ID of 1 is:

/wp-json/wp/v2/posts/1

Leave a Comment