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

CC BY-SA 4.0
2022-11-01T21:26:24.047Z
2022-11-01T21:26:24.047Z
Dalton Rooney
<p>I have a problem with preview links in a Craft multi-site configuration. We’re on Craft 3.7.x and have two sites: <code>default</code> and <code>staff</code>. Each site is configured with its own base URL, the default site is at <code>www.domain.com</code>, and the staff site is at <code>staff.domain.com</code>.</p>
<p>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: <code>{parent.uri}/{slug}</code></p>
<p>The problem is that the preview link (and the live preview iframe) always link to the <code>www</code> version of the page, even if you’re editing an entry in the <code>staff</code> site.</p>
<p>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.
 </p>
<p>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.</p>
<p><strong>Update</strong>: Confirming this behavior is the same in Craft CMS 4.2.x on a completely different site.</p>

<multi-site><live-preview><preview>
Multi-site entries have incorrect preview target
# Multi-site entries have incorrect preview target

(Asked by: username_0 on 2022-10-31)

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.

**Tags:** multi-site, live-preview, preview


---

## 1 answers

### Answer by username_0 on 2022-11-01. Score: 2

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


---

