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 "status":401
, or it should return "_res":"ok"
. If you don't see any of these strings, or you see any other status code besides 200
, 404
, or 401
, then the REST API is not working properly, or access to it has been blocked.
Note
As of LSCWP v6.2+, our REST API endpoint (?rest_route=/litespeed/v1/xxx
) makes use of IP verification. This means that only requests from QUIC.cloud's IPs will receive a 200 OK
response. Any requests from other IPs will receive a 401 Unauthorized
response, which is expected and perfectly normal.
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.
Unable to Generate Domain Key¶
As of the LiteSpeed Cache Plugin for WordPress v6.2, if you are using a reverse proxy (like Cloudflare), and you are unable to generate a QUIC.cloud Domain Key, you may need to make a simple change to LiteSpeed Web Server's Use Client IP in Header setting. Please see the full solution in the LSCWP documentation, or forward this link to your hosting provider.
Diagnosing a Problem¶
If there is some other 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.