Hi @tofuschnitzel
Do you happen to see any errors in your server PHP log files?
Also, you might find a better error on the network tab. See here:
Network tab: https://prnt.sc/ppytfu
Hi,
the only error in the php log is the 404 error mentioned above.
the network tab yielded this error:
XHRPOST
https://www.xxxx/wp-json/metaslider/v1/slideshow/save
[HTTP/2.0 404 Not Found 523ms]
JSON
code rest_no_route
message Es wurde keine Route gefunden, die mit der URL und der Request-Methode identisch ist.
data {…}
status 404
Response payload
1
{“code”:”rest_no_route”,”message”:”Es wurde keine Route gefunden, die mit der URL und der Request-Methode identisch ist.”,”data”:{“status”:404}}
Hi,
Can you check a few things?
1. Look in the plugin files for ml-slider/admin/routes/api.php
and at the bottom you will see a list of all the routes. The error is suggesting that /slideshow/save
does not exist, so check in this file to see if it’s registered (perhaps the file got corrupted).
2. Check the endpoints. Go to
https://www.xxxx/wp-json/metaslider/v1/
Then look for the listed routes.
Here’s from my dev site: https://prnt.sc/psnc6j
You might want to use this Chrome extension to make it readable: https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa
Let me know what you find.
PHP file is fine, endpoint also gets registered
https://ibb.co/jT2TsTz
but if I try to post to the save url “https://xxxx.at/wp-json/metaslider/v1/slideshow/save
(using insomnia) will yield the “rest_no_route” error
but I figured it out. I switch to apache instead of nginx and not it works. so it seems somthing in the nginx config prevented this url to be correctly interpreted (plesk)
Hi @tofuschnitzel
Thank you for the feedback. I’ll mark this as resolved. Could you share your nginx config file so I can take a look and see if there’s a possible solution? There have been a few similar reports lately and it would be good to be able to provided others with an easy copy/paste fix. Thanks
I’ve been using this in the “Additional NGINX directives” in plesk to make permalinks etc work.
if (!-e $request_filename){
rewrite ^(.*)$ /index.php break;
}
with the recent plesk upgrade to obisian this was not necesary anymore for the permalinks to work but it seems whatever plesk added to the nginx config for the permalinks does not make the json endpoints work.
after adding the above mentioned code it works again also with nginx.
I will later have a look at the config that obsidian generates and maybe we can find a clue as to why permalinks work but json and ajax endpoints dont.
(I will probably also create a post at the plesk forums)
Thanks, that will be very helpful.