wordpress wp-json prefix issue

image error

I’m using WordPress 4.9+ which I believe enabled with REST api by default. My permalinks are set to Month and Name And I’m using Foxhound React theme for my site.

Now my rest api should be available in

http://example.com/index.php/wp-json/wp/v2/posts

But its available in

http://example.com/index.php/wp-json/wp/v2/posts

This is why my theme gets 404 error when tries to get data from api.

Now my question is how do I make my REST available without the /index.php prefix

I’ve manually deployed everything in aws ubuntu micro with a Lamp server. WordPress files are in the root folder (/var/www/html/)

Also I have tried mod_rewrite module using the following steps

a2enmod rewrite
sudo service apache2 restart

Read more here:: wordpress wp-json prefix issue

Leave a Reply

Your email address will not be published. Required fields are marked *