4

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!

Villat
  • 1,455
  • 1
  • 16
  • 33
sorciereplum
  • 41
  • 1
  • 2
  • If you are a beginner I recommend installing WP on a live server such as GoDaddy or MediaTemple. They take care of server issues so that you can focus on WordPress rather than having to troubleshoot server issues from local wamp setups. – MistaPrime Oct 10 '19 at 00:34

2 Answers2

6

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.

Bharat Rawat
  • 161
  • 2
  • 7
  • 2
    This works; but only after I changed permalinks to `post name`. When it was `plain` aka the default setting it did not work. – GregT Aug 07 '21 at 01:49
0

If you're still working on it try the suggestions from this post: Wordpress REST API (wp-api) 404 Error Even if it's quite old there are some ideas you could try, like switching your permalink structure to sth. other than plain, check mod_rewrite under apache and so on. Classic Editor is not using the REST API, therefore no error.

Vortac
  • 508
  • 3
  • 10