Cornerstone conflict is back

Hello,
When attempting to edit pages in Cornerstone, i get the error “A conflict on the front end of your site has prevented the preview from loading.” I have been getting this error on and off (mostly getting the error) since installing X a week ago. Here is some information that may help diagnose the issue:

  • I am working with a staging site at staging2.waypointhealth.com
  • X theme 5.2.2 (child)
  • Cornerstone 2.1.3
  • PHP 5.6
  • No caching or security plugins
  • Currently all plugins except Cornerstone are deactivated
  • I don’t think we have any custom code (“custom” and “additional CSS” are empty in the customizer)
  • In Settings>General, Wordpress address and Site address are both http://waypointhealth.com (i.e. not https://) because we do not have a cert for this domain. Note they are pointed to the root domain, not the subdomain. More about that below.
  • SiteGround is the host. https://theme.co/apex/forum/t/popular-questions/204 says SiteGround blocks some Cornerstone resources, but it is unclear to me whether all staging sites hosted at SiteGround will simply be incompatible with Cornerstone until SiteGround changes something, or if there is a workaround or some circumstances when Cornerstone is compatible with SiteGround.

I have found that if I add the staging site subdomain to wp-config.php, like:
define(‘WP_HOME’,‘http://staging2.waypointhealth.com’);
define(‘WP_SITEURL’,‘http://staging2.waypointhealth.com’);
…then i can edit pages in Cornerstone, but i get a “too many redirects” error accessing the staging site itself even after clearing browser cache. I cannot find a configuration that allows me to access the site and edit in Cornerstone.

So there appears to be an issue with URL, but I am unsure of whether this is actually a symptom or some other problem or what the fix might be. Thank you for any suggestions. I am happy to provide site and FTP creds if that would help.
Brett

Hi There,

Thanks for writing in! Upon initial investigation, I suspect that your issue is related to the URL change. Use the latest database from your live site and then create your staging site again by following our migration guide (https://theme.co/apex/forum/t/cornerstone-content-builder-migration/126/1).

Hope that helps.

@mldarshana the link you sent was for “Cornerstone / Content Builder - Migration”. I do not have any Cornerstone content on my old site (i.e. my live site) so I do not need to migrate Cornerstone content to my staging site. Can you explain why you think Cornerstone migration would cause this issue, or what you mean by “your issue is related to the URL change”?

Hello There,

Sorry for the confusion. Your issue is because of the way SiteGround manage their staging sites. In other staging sites, the Site URL and WordPress Address URL should always be the same with the WordPress dashboard url. In SiteGround, it is different. Your staging is in http://staging.example.com yet when you check the Site URL in Settings > General, it is set to the main domain which is http://example.com.

Cornerstone is returning an error because it is using Site URL and this is why as soon as you edit your wp-config.php file and added define('WP_HOME','http://staging.example.com') Cornerstone works correctly with no errors. At the moment, we do not have any work resolution to this issue with staging sites hosted in SiteGround. The best you can do is to add/remove the lines in your wp-config.php so that you can edit and view your page created in Cornerstone.

Hope this explains it briefly.

@RueNel thank you for your response. I have a follow-up question regarding using Cornerstone to build a staging site hosted on SiteGround. I don’t exactly understand if/how Cornerstone saves URLs. If I use wp-config.php to set WP_HOME and WP_SITEURL to http://staging.example.com (of course, with my site’s actual domain), and then I use Cornerstone to build my site on staging, and when I’m finished I use wp-config.php to set WP_HOME and WP_SITEURL back to http://example.com, and then I deploy my staging site to production (both hosted on SiteGround), will Cornerstone automatically adapt to the new URL so that my production site will be usable on its own and configurable via Cornerstone on production site Wordpress dashboard?
Thank you.

Hi there,

It will adapt to the new URL, but it doesn’t mean that it also changed internal URLs added in your through during development. Changing base URL is only effective from the time it’s changed, old content that uses old URL will still remain. Which is why there are tools for migration as changing base URL isn’t enough.

Unchanged internal URLs causes MIXED content issue in which affecting the functionality of the builders and other plugins.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.