Support » Fixing WordPress » The REST API encountered an unexpected result = 404 Not Found error

    • On iMac. Running Catalina 10.15.18 (highest I can go). Using Google Chrome 92.0.4515.131. Also tried Firefox 90.0.2 (64-bit)

    ISSUE:
    After update to WP 5.8 I went to a page to edit it. I clicked “view” and received error:

    “Not Found. The requested URL was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.”

    Dashboard > Site Health Status > The REST API encountered an unexpected result:

    “`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) <!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL was not found on this server.</p> <p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p> </body></html> .`”

    I read instructions about 5.8 to log out, clear cache etc. and log back in, however, it didn’t resolve issue.

    Any help is appreciated. I am a novice here. Thank you.

    • This topic was modified 3 months, 3 weeks ago by paperwork queen. Reason: Updated website URL

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter paperwork queen

    (@paperwork-queen)

    Was able to resolve 1 of the 2 issues mentioned above. I can now see each page with the “view” button, I do not get the 404 error page. I resolved this by referencing this page: https://wordpress.org/support/article/post-status/

    My site is under construction. So I set 6 pages that are completed to “private” and “pending review” and the 6 I am still working on to “draft” and unchecked private.

    I logged out, cleared cache and cookies and logged back in, however, I still get the Site Health Status > “The REST API encountered an unexpected notice” error in the dashboard.

    • This reply was modified 3 months, 3 weeks ago by paperwork queen. Reason: changed word from review to resolve

    At the risk of being “told off” to start a new thread, I’m having the exact problem with WP 5.8 on Ubuntu 20.10. Only the home page and admins display without error.

    Thread Starter paperwork queen

    (@paperwork-queen)

    I ended up calling my host who normally won’t address WP issues, however, tech support was willing to give it a shot and he resolved my issue by going into the “Permalink Settings” and changing under the “Common Settings” from “Day and Name” to “Post Name.” No clue how this would fix issue, but it did.

    @starapple I wish I knew how to resolve that issue you are having. I will leave this open in hopes someone has advice.

    @paperwork-queen, for sure it’s related to permalinks and redirection settings. In my case, the default permalink (plain) is the only one that works and I suspect that’s because there’s no redirection and an empty .htaccess is set.

    Glad your host was able to help you.

    • This reply was modified 3 months, 2 weeks ago by starapple.

    I have a pretty fresh system running on Debian 11, so I inevitably encounter missing WordPress 5.8 dependencies on other software. I have Apache2.4, PHP 7.4 and Mysql/mariadb 15.1.

    So, I got the same JSON error message as you guys, but after a few more grey hairs I step-by-step managed to find the solution.

    I had to:
    – create .htaccess file as instructed in the Admin panel Permalink settings.
    – enable rewrite for Apache: a2enmod rewrite
    – insert a few lines into the Apache conf-file where my WordPress site is specified:
    <Directory /whatever/your/wp/path/is>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
    </Directory>
    – restart apache2

    Now, I can set the permalink address structure I want – and no more JSON errors.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.