When multiple custom domains are mapped to the same Experience Cloud site and users log in through an Authentication Provider (Auth Provider) — such as Azure Active Directory or Google — they are always redirected to the site's primary domain URL after a successful login, regardless of which custom domain they used to start the login process.
Example: If both 'example.com' and 'example.cn' are mapped to the same Experience Cloud site, and 'example.cn' is alphabetically first in the Custom URLs list, a user who starts login from example.com is redirected to example.cn after completing authentication through the Auth Provider.
This is expected platform behavior and is not a product defect.
Root Cause
When multiple custom domains are associated with the same Experience Cloud site and no Primary URL is explicitly selected, Salesforce determines the redirect destination using the first HTTPS custom URL in alphabetical order. During the Auth Provider authentication process, Salesforce redirects users to this effective primary URL — even if they initiated login through a different custom domain.
How to identify your primary domain
The primary domain is the URL displayed for your site in the 'All Sites' section in Salesforce Setup.
This behavior is by design. To control which domain users are redirected to after Auth Provider authentication, explicitly set a Primary URL for your Experience Cloud site.
Steps to set a Primary URL:
Note: The External Host — the domain users type into their browser — is not affected. Only the post-authentication redirect destination changes based on the Primary URL setting.
005387489

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.