• Resolved Alan Stewart

    (@heartstone)


    Earlier tonight I migrated a new client site to a temporary URL using the SG migration plugin. When I try to activate the SG optimizer plugin, I get the error “could not connect to the WordPress REST API.”

    I’ve turned off all plugins except SG optimizer, cleared all the caches, and reset the htaccess file to this:

    `<IfModule mod_rewrite.c>
    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]
    </IfModule>

    Any suggestions for fixing this? Thanks for any help you can offer!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Alan Stewart

    (@heartstone)

    Edit: forgot to include the temporary URL. https://alans56.sg-host.com/

    I’ve also tried removing the temporary site and running a new migration. Here’s the updated htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
     RewriteEngine On
     RewriteBase /
     RewriteRule ^index\.php$ - [L]
     RewriteCond %{REQUEST_URI} !/(wp-content\/uploads/.*)$
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    
    # SGO Unset Vary
      Header unset Vary
    # SGO Unset Vary END
    • This reply was modified 3 years, 7 months ago by Alan Stewart.
    Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    Hey there @heartstone ,

    Make sure that your WordPress Address and Site Address in the Settings/General is properly configured.

    Right now, the rest request has been blocked by CORS policy because of the way they are set. When you properly configure them, there should be no issues.

    However, if you have any issues, feel free to reach back to us.

    Kind Regards,
    Stoyan

    Thread Starter Alan Stewart

    (@heartstone)

    I think my problem may have stemmed from using the plugin on a temporary SiteGround account rather than a transferred domain. I transferred a domain and the plugin is now working.

    Plugin Author Elena Chavdarova

    (@elenachavdarova)

    Thank you for your update, @heartstone.

    I am glad the issue is resolved now.

    Best Regards,
    Elena

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Could Not Connect to WordPress REST API’ is closed to new replies.