Rest API not working on Multisite

[ad_1]

Hello @shadialaghbari,

The message usually indicates that a security plugin is blocking the access. If you already tried disabling all plugins there is a high probability that the issue is caused by a custom function or a .htaccess rule. Keep in mind that rules written the .htaccess may remain there after a security plugin is disabled.

Additionally, you can also check your browser console for any errors that could indicate the exact reason for the API to not function properly.

If the error persists and your site is hosted with SiteGround please open a support request through your Client Area. This will allow us to investigate the case in detail while having the necessary access to your site and its configuration.

Best regards,
Dimo

Hello @dimodi ,
I have disabled all plugins, and the also my theme, so from where that custom function will come?

This console errors:

image link: https://ibb.co/Mc8nPcP

And here is my .htaccess file:

### Rewrite Rules Added by CyberPanel Rewrite Rule Generator

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.(.*)$
RewriteRule ^(.*)$ http://%1/$1 [L,R=301]

### End CyberPanel Generated Rules.

### Rewrite Rules Added by CyberPanel Rewrite Rule Generator

RewriteEngine On
RewriteCond %{HTTPS}  !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

### End CyberPanel Generated Rules.


# BEGIN WordPress
# Les directives (lignes) entre « BEGIN WordPress » et « END WordPress » sont générées
# dynamiquement, et doivent être modifiées uniquement via les filtres WordPress.
# Toute modification des directives situées entre ces marqueurs sera surchargée.
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
# END WordPress

There should be no issues with the provided htaccess directives. You can perform further tests using only the default Multisite htaccess directives, check for scripts definitions in php.ini./.user.ini files, etc. Also, despite the fact that plugins are deactivated, their files still could be executed. If you suspect such issue, you can move the plugins outside the default directory.

If your website is hosted on SiteGround servers, please open a ticket on our end so we can perform further investigation.

Best Regards,
Dimitar Petrov

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer