1

I have a problem with preview links in a Craft multi-site configuration. We’re on Craft 3.7.x and have two sites: default and staff. Each site is configured with its own base URL, the default site is at www.domain.com, and the staff site is at staff.domain.com.

Entries in the “pages” section are enabled for both sites, with “Only save entries to the site they were created in” as the propagation method. The Entry URI format and the URL format for the Preview target area all the same: {parent.uri}/{slug}

The problem is that the preview link (and the live preview iframe) always link to the www version of the page, even if you’re editing an entry in the staff site.

From the entries listing in the CP, the little “globe” icon next to each entry does in fact link to the correct URL. The structure works completely fine on the front-end. 


One more note: this is not a CORS or CSP issue, the problem isn’t that the preview won’t load, it’s that the preview is pointing to the wrong URL. If there is some kind of cross-domain issue we'll figure that out once the correct URL is loading.

Update: Confirming this behavior is the same in Craft CMS 4.2.x on a completely different site.

1 Answer 1

2

The pattern for the first Preview Target should just be {url}, not {parent.uri}/{slug}.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.