• Hello,

    I hope I can get some help. I have been trying solutions I see online relating to this problem but no solution to this problem for me so far.

    Originally everything works well as it should be but I don’t know why I started to get the error message each time I try to publish or update a post or page “Publishing failed. The response is not a valid JSON response.”

    In addition to this, when use the option for “post name” in permanlink, the page returns “The requested URL was not found on this server.Apache Server at Port 443”

    When I used the “plain”, the page displays content but this is not good for SEO. I tried using the “post name” again after clearing .htaccess according to some of the information I found but still no resolution.

    I also get a message from the site health that

    I also got this from error message from the SEO plugin I am using”
    AIOSEO relies on the WordPress Rest API and your site might have it disabled” The information in the link provided for me information did not give exact solution. How do I enable “Rest API”, if this might be the problem.

    I do not understand exactly what I am supposed to do to enable REST API from the information I got researching, I am not a developer. It seems the REST API information given is for those developing plugins that need REST API not exactly for end users like me in this situation.

    from the site health check, I also get report “The REST API encountered an unexpected result” and there is no indication on how to fix this.

    I have diabled plugins one after the other but no resolution.

    I use theme “Mesmerize”, I swapped for twenty-twenty-two and twenty-twenty-three but the problem remains.

    Webiste is hosted on google cloud Compute Engine

    I will appreciate any directions towards fixing.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • It seems the REST API information given is for those developing plugins that need REST API not exactly for end users like me in this situation.

    Not exactly. That’s because WordPress itself uses the REST API internally. That’s why you’re unable to publish or edit a page.

    In any case, your REST API is actually active and working.

    The default “plain” URL for the REST API works:
    https://www.webhostville.com/hostville/?rest_route=/

    This explains why everything works when you’re using the “Plain” permalink.

    But the “pretty” URL does not work, returning 404: https://www.webhostville.com/hostville/wp-json/

    And this is consistent with all public URLs on your site not working when you switch to any permalink option other than PLAIN.

    So this is a PERMALINK problem, and not a REST API problem.

    Something is clearly broken on your server preventing the URL rewriting to work, which is why both your public pages and REST API endpoints are broken and returning HTTP status 404 (not found).

    Thread Starter whvs

    (@whvs)

    Hello George.

    Thanks for your response, any idea what I should be looking at to solve these problems.

    I have tried many of the solutions I researched none worked?

    Thanls

    Thread Starter whvs

    (@whvs)

    I was able to resolve the problem.

    The problem lies with the apache configuration. I substitute a component of the configuration and the 404 error cleared and REST API issue also resolved. I can create, save and update pages too.

    $ sudo nano /etc/apache2/apache2.conf

    <Directory "/var/www/html">
    Options FollowSymLinks
    AllowOverride All
    Require all granted
    </Directory> 

    Instead of AllowOverride All, I had AllowOverride None. I replaced and all problems solved.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘I need help to fix error with failed publishing, REST API and page not found.’ is closed to new replies.