Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

REST API encountered an unexpected result

Rest Api Warning in Wordpress

         

elvang

10:03 am on May 26, 2022 (gmt 0)

Top Contributors Of The Month



Hi,
On my wordpress dashboard i am seeing that kind of warning:

"
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> <hr> <address>Apache/2.4.41 (Ubuntu) Server at www.example.com Port 443</address> </body></html> ."

Beside this i am unable to create new pages on wordpress. How can I solve this problem? Thank you.

not2easy

1:17 pm on May 26, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Are your 404 errors being redirected to a specific html page in a server configuration file or in a directory .htaccess file? This is not the way WordPress handles 404 errors by default. That looks like a really old server default page. You can disable the block editor if you prefer to use the default editor.

elvang

2:36 pm on May 26, 2022 (gmt 0)

Top Contributors Of The Month



when i try to create a page i am seeing "Updating failed. The response is not a valid JSON response."

Beside this which editor should I use block editor or default editor?


This is my server configuration file I didnt made any configuration on htaccess:

<Directory /var/www/html/example.com/public_html>
Require all granted
</Directory>
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName www.example.com
ServerAlias example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/example.com/public_html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog /var/www/html/example.com/log/error.log
CustomLog /var/www/html/example.com/log/access.log combined
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^(www\.example\.com)? [NC]
RewriteRule ^(.*)$ https://www.example.com$1 [L,R=301]
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet