Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Select correct site when using multiple domains #11042

Open
wants to merge 2 commits into
base: 5.x
Choose a base branch
from

Conversation

aerni
Copy link
Contributor

@aerni aerni commented Nov 1, 2024

This PR updates the SelectedSite middleware to set the correct site in the CP when using different domains.

Consider this sites config.

'sites' => [
    'english' => [
        'url' => 'https://english.com',
    ],
    'french' => [
        'url' => 'https://french.com',
    ]
]

Users can access the CP through https://english.com/cp and https://french.com/cp.

So far, the global sites selector would pick the default site when first logging in. No matter what domain you're on. This PR changes this to select the site by URL. This selection only happens when first logging in. So subsequent changes to the selected site will still work and not be overridden by this automatic selection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants