2

We have a Wordpress website, hosted by GoDaddy. Before we went "live" we had it located at staging.coiski.com (wordpress was installed in a folder called /staging), and then when we went "live" we moved it to coiski.com using the following instructions:

askwpgirl.com/move-wordpress-from-subdirectory-to-root-directory

In the process of the move, everything worked except our WPB Filterable Portfolio plugin on the coiski.com/work page. Specifically, none of our lightboxes are working, and we are getting the following message:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://staging.coiski.com/wp-admin/admin-ajax.php. (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘http://coiski.com, *’).

Here's what we've tried, to no avail:

Adding the following code to our .htaccess file:

<FilesMatch "\.(php)$"> 
 <IfModule mod_headers.c> 
 Header set Access-Control-Allow-Origin "*" 
 </IfModule> 
</FilesMatch>

Adding the following code to our header.php file:

header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: GET, POST');

Any other ideas what we could try? Any help would be greatly appreciated.

Jon Zmikly
  • 23
  • 1
  • 3

1 Answers1

2

It look likes your WP is still setup to http://staging.coiski.com domain.

You can change it in MySQL database - table named {wpdb prefix}_options with option name siteurl and home

Or you can enforce it in yours wp-config.php by these consts:

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

You can read about it here: https://codex.wordpress.org/Changing_The_Site_URL#Edit_wp-config.php

Jiri Kral
  • 161
  • 4
  • THANK YOU SO MUCH! I really can not thank you enough. You really saved me big time!!!! – Jon Zmikly Nov 18 '16 at 02:43
  • The actual problem was that in my Wordpress Address (URL), I had typed in staging.coiski.com instead of coiski.com/staging. All is well! – Jon Zmikly Nov 18 '16 at 04:36