Here is the issue. Using plain permalinks, the site works, .htaccess contains nothing and permalink structures and rewrite rules in wp\_options are also null. I can edit pages and posts without error.
If I change the permalinks to “Day and name”, which is how the site was built, .htaccess populates properly and does permalink structures and rewrite rules in wp\_options. But the site breaks. All pages generate a 404 error. Additionally, editing a page or post results in a “Updating failed. The response is not a valid JSON response.” error.
I have root shell access to the server and full root access to the database so I can pretty much do anything, but I have no idea what to do.
I’ve followed the guides on line. Obviously changing the permalinks does nothing. The classic editor does eliminate the JSON error, but accomplishes nothing else.
It seems that everything works properly – .htaccess generates as expected, database updates occur. It just doesn’t seem to be following the rewrite rules. It processes them, resulting in the error if they contain anything but doesn’t follow them.
Any ideas?
[ad_2]
Link? If you click “View” on a post in the backend, does the post load correctly? How do you trigger a 404 i.e. what are you clicking on?
Have you followed the guide here to fix the JSON issue? [https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-invalid-json-error-in-wordpress-beginners-guide/](https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-invalid-json-error-in-wordpress-beginners-guide/)
What theme are you using? And what version is it?
Is your SSL setup correctly?
Are you actually using Apache for the webserver? Htaccess files don’t work with Nginx or other web servers.
> “Updating failed. The response is not a valid JSON response.”
This is expected when you have activated permalinks but they don’t work properly. The (new) editor want to access example.com/wp-json/ and gets an error response which it cannot parse to JSON.
So the problem is that your server cannot process the requested pretty URLs.
– What’s your hoster?
– Is mod_rewrite enabled? (check this with phpinfo())
– Are you using apache?
– Are you running your site on the root level or in a subdirectory?
– Are you sure you checked the right .htaccess file in the right place?
You can temporary place `flush_rewrite_rules(true)` in your functions.php, but normally shouldn’t be necessary.