Overview

The WordPress REST API is an interface which allows certain scripts, plugins and remote systems to interact with your website. If you’re seeing either through the WordPress Site Health tool or from a service which uses it that a 401 is returned (a HTTP Status Code) then it may be that your .htaccess file is out-of date.

Instructions

  1. Login into Plesk via the Conetix Control Panel.
  2. Go the File Manager:
    wordpress rest api returns a 401 error
  3. Within the httpdocs directory, locate the .htaccess file and edit by clicking on it:
    wordpress rest api returns a 401 error
  4. Ensure it contains the standard WordPress rewrite rules, including the key Authorization line:
# BEGIN WordPress

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

You can always review the Official WordPress documentation on .htaccess files for further information.

Note

If you’re unsure about editing this file or not sure what it means, we highly recommend you simply contact your developer to assist.

Was this article helpful?

Related Articles