This thread is resolved. Here is a description of the problem and solution.
Problem: You are experiencing issues with editing a page on your multisite setup, where attempting to edit the page forces a login screen, and subsequent login redirects you back to a different domain. Solution: We recommend checking the 'Automatically log in and log out users across all domains' option in your WPML settings. This setting can be found under WPML > Languages in your WordPress admin area. Enabling this option should resolve the issue of being redirected after logging in. If you need to log in again when trying to edit the page, this should be expected, but it should allow you to proceed with editing without further redirections.
Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
I have a multisite with two domains: 360px.pl and 360care.pl. In the second domain 360care.pl, I have WPML with separate domains (360px.pl and 360care.site). I want to edit the page hidden link. I have a sunrise.php file like in your documentation.
Symptoms:
When I try to edit the page hidden link, the system forces a login page. After logging in, the system redirects me to 360care.pl.
Questions:
Why does the system force a login page when I try to edit hidden link?
Why am I redirected to 360care.pl after logging in?
if ( isset( $_SERVER[ 'HTTP_HOST' ] ) ) {
// Get the current domain
$domain = $_SERVER['HTTP_HOST'];
// Define a mapping of domains to site IDs in your multisite
$domain_mapping = array(
'360care.pl' => 1, // Blog ID 1 for 360care.pl
'360care.site' => 2, // Blog ID 2 for 360care.site
'360px.pl' => 3, // Blog ID 3 for 360px.pl
);
// Switch to the corresponding site based on the current domain
if ( array_key_exists( $domain, $domain_mapping ) ) {
switch_to_blog( $domain_mapping[ $domain ] );
}
}
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
The code I provided should be placed in the sunrise.php file, not in functions.php, because sunrise.php is specifically designed for handling domain mapping in WordPress multisite setups.
Also, ensure that your wp-config.php file has the following line to enable sunrise and domain mapping:
Previous one.
This time when I try to edit elementor, system redirects me to the Homepage of 360px.agency. Link to edit this page has hidden link domain, so that's correct. hidden link