CPT without slug after domain mapping

The solution was actually quite lightweight. I found it by inspecting the plugin code. Luckily, plugin developer put a lot of filters and actions to extend and modify plugin functioning, so solution is also futureproof. The slug used for custom post type here is uciliste.

Somewhere in PHP which loads before page (e.g. functions.php) this should be put:

// map all uciliste pages through falke plugin
add_filter( 'falke_mdmf_request_uri', function($newRequestURI) {
    return  $newRequestURI . ($newRequestURI === '/uciliste/' ? 'uciliste/' : '');
});

This filter prevents double slug appearing in url, like this: https://seconddomain/uciliste/uciliste (the first comes from cpt slug, second from remapping)

Further, in plugins settings the slug /uciliste should be mapped to second domain, and that’s it.

tech