Skip to content

[5.x]: Multisite: Backend editor/media links stick to login site after top-bar switch (confusing UX) #18698

@rabinredpin

Description

@rabinredpin

What happened?

Description

On a Craft multisite installation (5.x), switching sites from the top admin bar correctly resolves the frontend preview/context for the selected site. However, the backend editor (entry editors, asset modals, etc.) and media-related links still appear to use the originally logged-in site's context/base URL.

Steps to reproduce

  1. Log into the control panel via Site A’s domain (e.g., sitea.example.com/admin).
  2. Switch to Site B using the site switcher in the top admin bar.
  3. Open an entry editor or asset field for Site B content.
  4. Observe media/asset links and editor preview URLs — they point to Site A’s domain/context.
  5. Frontend preview resolves correctly to Site B.

Expected behavior

Editor links/assets should immediately reflect the switched site's context, matching frontend behavior.

Actual behavior

Backend stays tied to the login site's context. Frontend correctly uses the active site's Base URL.

Why it's confusing:
Authors expect a seamless switch — previewing/editing Site B content should fully use Site B’s URLs everywhere. This creates cognitive dissonance when backend links don't match what authors see on frontend.

Craft CMS version

5.9.14

PHP version

8.2.3

Operating system and version

Linux 6.17.0-1010-azure

Database type and version

8.2.30

Image driver and version

GD 8.2.30

Installed plugins and versions

Contact Form | 3.1.0
Contact Form Honeypot | 2.1.0
Control Panel CSS | 3.0.0
Feed Me | 6.11.0
Field Manager | 4.0.3
Google Maps | 5.2.0
Linkit | 5.0.0
Navigation | 3.0.17
Position Fieldtype | 5.0.0
reCAPTCHA | 3.0.0
Redactor | 4.2
SEO | 5.1.20
Super Table | 4.0.5
Table Maker | 5.0.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions