WP rest api returns 404 only when author param is used


I have a multisite wordpress installation on aws linux, working perfectly fine. The WP Rest api is also working exactly as it should. Except for one single case.

/wp-json/wp/v2/posts?author=<some int>

For everything else, including my custom endpoints, and custom params/fields added to the api, it works perfectly. But the moment i add the author part, it returns 404 on all sites. eg:

/wp-json/wp/v2/posts?author_exclude=1     //this works
/wp-json/wp/v2/posts?page=2               // this also works
/wp-json/wp/v2/posts?page=2&author=abc    // this also works and returns invalid author
/wp-json/wp/v2/posts?page=2&author=1      // this returns 404 page not found

From some of the other similar questions, I found that this issue could be due to permalinks, but I am using custom permalinks


I have tried changing the permalink to no effect. Another solution I found is to change all the deny to allow in htaccess. I am not well-versed in htaccess, so i have not modified it for fear of causing some security issues.
As for other related info, I am also using jwt and disable rest api plugin(with only jwt endpoints enabled).

Any help would be appreciated, please.

Deepon GhoseRoy 3 months 0 Answers 16 views 0

Leave an answer