Hi Matt,
Can you share which line numbers in the plugin code create the domain flip(s)? I want to wrap them with conditional code – if url contains “preview=true” do not make anything.
Is it line numbers 182 – 208? This code:
global $falke_mdm_currDomain;
function falke_mdm_parse_request($parse, $instance, $extra_query_vars){
global $falke_mdm_domains;
global $falke_mdm_destinations;
global $falke_mdm_tab2;
global $falke_mdm_currDomain;
//check if the compatibility option is set
if(isset($falke_mdm_tab2["server_variable"]) && $falke_mdm_tab2["server_variable"] === "HTTP_HOST"){
$falke_mdm_currDomain = untrailingslashit(esc_url($_SERVER['HTTP_HOST']));
}else{
$falke_mdm_currDomain = untrailingslashit(esc_url($_SERVER['SERVER_NAME']));
}
falke_mdm_debug_dump($falke_mdm_currDomain, "domain");
falke_mdm_debug_dump($_SERVER['REQUEST_URI'], "request uri");
if(in_array($falke_mdm_currDomain, $falke_mdm_domains)){
$pos = array_search($falke_mdm_currDomain, $falke_mdm_domains);
$_SERVER['REQUEST_URI'] = "/".trim($falke_mdm_destinations[$pos], "/").$_SERVER['REQUEST_URI'];
//falke_mdm_debug_dump($_SERVER['REQUEST_URI'], "request uri changed");
}
//falke_mdm_debug_dump($falke_mdm_currDomain,"domain");
return $parse;
}
add_filter('do_parse_request','falke_mdm_parse_request',10, 3);
Thanks,
Dean