• Hey guys!
    First of all, thank you for this amazing plugin.

    I’m trying to using it for one of my landing pages and it’s working very well but when I share some of the subpages on Facebook or any other pages that include parameters (like UTM for example) it are redirected to 404 page.

    I don’t think that’s the best option but for now (as a workaround) I’m using the https://redirection.me/ free plugin and creating a redirect like this:

    https://myparkeddomain.com.br/subpage/?fbclick=xxxxxxx

    Always redirect to:

    https://myparkeddomain.com.br/subpage/

    That worked for now but I’ll have to create a redirection for each subpage.

    There’s something I can do about that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author matthias.wagner

    (@matthiaswagner)

    hy,

    thank you for that hint. we have heard about that already a few months ago and did not yet fix it. i’m afraid you will have to keep that workaround by now, but we are definitely aware of that ??

    @user125, please have a look at this thread if you still need to fix that.

    matt

    Any update on this?

    In multiple-domain-mapping-on-single-site/multidomainmapping.php
    Find and replace the function.

    //change the request, check for matching mappings
    public function parse_request($do_parse, $instance, $extra_query_vars){
    //store current request uri as fallback for the originalRequestURI variable, no matter if we have a match or not
    $this->setOriginalRequestURI($_SERVER[‘REQUEST_URI’]);

    //definitely no request-mapping in backend
    if(is_admin()) return $do_parse;

    //loop mappings and compare match of mapping against each other
    $mappings = $this->getMappings();
    if(!empty($mappings) && isset($mappings[‘mappings’]) && !empty($mappings[‘mappings’])){

    foreach($mappings[‘mappings’] as $mapping){
    //first use our standard matching function
    $new_url = explode(‘?’, $this->getCurrentURI());
    $new_url = trailingslashit($new_url[0]);
    $matchCompare = $this->uriMatch($new_url, $mapping, true);

    //then enable custom matching by filtering
    $matchCompare = apply_filters( ‘falke_mdmf_uri_match’, $matchCompare, $new_url, $mapping, true );

    //if the current mapping fits better, use this instead the previous one
    if($matchCompare !== false && isset($matchCompare[‘factor’]) && $matchCompare[‘factor’] > $this->getCurrentMapping()[‘factor’]){
    $this->setCurrentMapping($matchCompare);
    }
    }

    //we have a matching mapping -> let the magic happen
    if(!empty($this->getCurrentMapping()[‘match’])){
    //store original request uri
    $this->setOriginalRequestURI($_SERVER[‘REQUEST_URI’]);
    //set request uri to our original mapping path AND if we have a longer query, we need to append it
    $newRequestURI = trailingslashit($this->getCurrentMapping()[‘match’][‘path’] . substr(str_ireplace(‘www.’, ”, $new_url), strlen(str_ireplace(‘www.’, ”, $this->getCurrentMapping()[‘match’][‘domain’]))));

    //enable additional filtering on the request_uri
    $_SERVER[‘REQUEST_URI’] = apply_filters(‘falke_mdmf_request_uri’, $newRequestURI, $new_url, $this->getCurrentMapping());

    }
    }

    return $do_parse;
    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Links with parameters like UTMs’ is closed to new replies.