• Resolved aymanpfs

    (@aymanpfs)


    This issue is showing in site health of my website Admin:
    The REST API did not process the context query parameter correctly.

    I have seen a fixing for it in https://cloudtech.org/wordpress-sitehealth-shows-restapi-did-not-behave-correctly/

    as following:

    on Nginx, add a server block to your nginx config:

    location ~ ^/wp-json/ {
    rewrite ^/wp-json/(.*?)$ /?rest_route=/$1 last;
    }

    I want to ensure from this solution before I follow & apply it to avoid any errors or fail is caused to my website.

    if it’s not a right way, please I want a guide to solve this problem.

    • This topic was modified 4 years, 2 months ago by aymanpfs.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator t-p

    (@t-p)

    What did you do to the site before this error occurred? Update WP? Update plugins/theme? Modified files, etc.?

    Thread Starter aymanpfs

    (@aymanpfs)

    Just I was working on Rank Math SEO plugin settings, no more.

    Moderator t-p

    (@t-p)

    Try:
    – deactivating ALL (yes all) plugins temporarily to see if this resolves the problem (plugin functions can interfere). If this works, re-activate them individually (one-by-one) to find the problematic plugin(s).
    – switching to the unedited default Theme (Twenty Twenty, etc.) for a moment using the WP dashboard to rule out any theme-specific issue (theme functions can interfere like plugins).

    Thread Starter aymanpfs

    (@aymanpfs)

    I have deactivated already all plugins as your instructions, and I have re-activated one by one, but nothing happened, the problem is still.

    Thread Starter aymanpfs

    (@aymanpfs)

    When I have tried switching to: Twenty Twenty theme, the website has gone wrong
    (the images & menus disappeared), and converted to text.

    I have the same error in my webpage, I am just starting my website so I do not have any plugin installed, just a theme I bought from a developer, according to the developer this could be a problem of the core.
    I have not noticed any issue with this error appearing but would like to get rid of it.

    Did you use the fix on Nginx? did it work?

    I solved it with this: https://developer.www.ads-software.com/rest-api/frequently-asked-questions/#query-parameters-are-not-working

    If you find that query parameters such as ?page=2 or ?_embed are not having any effect, your server may not be properly configured to detect them. If you are using Nginx to serve your website, look for a try_files line in your site configuration. If it looks like this:

    try_files $uri $uri/ /index.php$args;
    change it to this:

    try_files $uri $uri/ /index.php$is_args$args;
    Adding $is_args (which will print a ? character if query arguments are found) will allow WordPress to properly receive and interpret the query parameters.

    Moderator t-p

    (@t-p)

    Glad its sorted ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘The REST API’ is closed to new replies.