Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hello all. I had same issue and used a few days in frustration. But finally i have a fix for elementor multi domains support on single site. If you used this plugin and enable the right Cors policy in your htaccess. I use the following:

    <FilesMatch “\.(css|js|ttf|ttc|eot|woff|woff2|otf|svg|gif|ico|webp|png|php|jpe?g)$”>
    <IfModule mod_headers.c>
    SetEnvIf Origin “http(s)?://(www\.)?(website\.com|website\.se|website\.co.uk)$” AccessControlAllowOrigin=$0
    Header set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
    Header set Access-Control-Allow-Methods: “*”
    Header set Access-Control-Allow-Headers: “Origin, X-Requested-With, Content-Type, Accept, Authorization”
    Header merge Vary Origin
    </IfModule>
    </FilesMatch>

    The issue then is that your ajax-admin.php still uses the original path/url when you try to edit a page thats on an other domain. You should do following.

    1. add following to you wp-config file
    define(‘WP_SITEURL’, ‘https://&#8217; . $_SERVER[‘HTTP_HOST’]);
    define(‘WP_HOME’, ‘https://&#8217; . $_SERVER[‘HTTP_HOST’]);

    2. add following code to functions.php in the theme you are using:
    function modify_adminy_url_for_ajax( $url, $path, $blog_id ) {
    if ( ‘admin-ajax.php’ == $path ) {
    $url = ‘admin-ajax.php’;
    }
    return $url;
    }
    add_filter( ‘admin_url’, ‘modify_adminy_url_for_ajax’, 10, 3 );

    This will make url work on multi domains by making the paths relative.

    This is testet and working with polylang multilingual plugin.

    Hope this helps all you folks ??

Viewing 1 replies (of 1 total)