Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordrpress wp-json not found on server -- localhost

Here's the sitch:

I downloaded and installed Wampserver64 and Wordpress 5.2.3

I finally made it to my site, but I can't preview or publish pages with the new Gutenberg or block editor because something is broken! When I edit with the Classic Editor, it's all good.

****Here's not the notice I get from the Site Health Plugin****

The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages. The REST API call gave the following unexpected result: (404) Not Found The requested URL /wordpress/wp-json/wp/v2/types/post was not found on this server. Apache/2.4.39 (Win64) PHP/7.3.5 Server at sitefolder Port 80

I have scoured the internet on how to fix this but so far nada. Help much appreciated!

like image 362
sorciereplum Avatar asked Oct 18 '25 00:10

sorciereplum


1 Answers

You have to add index.php after your folder name in the URL in order to make WordPress API work on the localhost. For example: localhost/trial-wordpress/index.php/wp-json/wp/v2/posts

It worked for me.

like image 64
Bharat Rawat Avatar answered Oct 21 '25 06:10

Bharat Rawat