Skip to content

Solving WordPress REST API issues

Some QUIC.cloud issues are actually due to a problem with the WordPress REST API. One example of such an issue:

  • Error adding your domain's IP address to your dashboard's Settings > Server IP.

It possible to solve issues like this simply by making sure the REST API is active.

Verify REST API is Active

Using curl, or an incognito browser window, visit this address, replacing example.com with your own domain:

https://example.com/?rest_route=/litespeed/v1/token

You should see something like this:

{"code":"rest_no_route","message":"No route was found matching the URL and request method.","data":{"status":404}}

Or you may see something like this:

{"_res":"ok"}

The last part of the string that is returned should say "status":404, or it should return "_res":"ok". If you don't see either of these strings, or you see any other status code besides 404, then the REST API is not working properly, or access to it has been blocked.

Add LiteSpeed Endpoints to Allowlist

It's possible you have a firewall that is blocking access to one or more LiteSpeed endpoints. Try adding /litespeed/v1 to your allowlist. That string will appear in all LiteSpeed endpoints.

Diagnosing a Problem

If there is a problem with your REST API, here are a few possible causes:

REST API Disabled

You may have simply disabled REST API. Re-enable it to fix the problem. If you don't know how to do this, the WordPress REST API Handbook may help.

Plugin Problems

  • You may have a security plugin that interferes with it.
  • You may have a plugin that controls or limits access, like a "maintenance mode" plugin.
  • You may have a plugin that is known to cause WP REST issues.

Try disabling your plugins one-by-one to find the culprit.

ReWrite Rule Problems

The REST API link relies on a rewrite rule to work. Situation like these, that causes the WordPress rules not to be processed, are problematic:

  • You may have permalinks set to Plain or /index.php/.
  • You may have a rewrite rule in .htaccess that ends in [L] but appears before the WordPress section.

Change your permalinks setting, or move your rewrite rules after the WordPress section to solve the problem.


Last update: February 16, 2024