• Resolved Shadi G ???? ??

    (@shadialaghbari)


    I get this message:
    Either a security plugin, custom function, or rules in your .htaccess file is preventing the WordPress REST API from working properly. SiteGround Optimizer is using it to store its options and other functionalities, so please make sure it works properly.

    Note: I disabled all plugins, and I don’t have any security plugins or SEO yet. .htaccess also looks fine. So I don’t know what is the problem.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Dimo Dimov

    (@dimodi)

    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

    Thread Starter Shadi G ???? ??

    (@shadialaghbari)

    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 ^(.*)$ https://%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
    Plugin Support Dimitar Petrov

    (@demiro)

    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

    Thread Starter Shadi G ???? ??

    (@shadialaghbari)

    Problem not resolved…. why only your plugin does not work…. it should not be that difficult to run. should figure out away to make more simple.

    Plugin Support daniellaivanova

    (@daniellaivanova)

    Hello @shadialaghbari,

    The SiteGround Optimizer plugin itself does not block the WordPress Rest API and you can verify that by activating it on a default installation. My colleagues have already outlined the potential reasons why the API might not be working on your website.

    Still, if you experience further issues with the Rest API, you can consider contacting your hosting provider. If your website is hosted at SiteGround, you can easily contact us from your User Area and we will look into the problem in detail.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Rest API not working on Multisite’ is closed to new replies.