Domain Mapping to Specific page or post

Hi, is it OK to modify installed plug ins and do you offer a little assistance with that? (Meaning questions not asking you to code lol)

I need to modify the domain mapper so it will allow users to map to a specific page or post with a domain.

http://domain.com => sites.mywordpress.com/posts/helloworld

  • Predrag Dubajic

    Hey @Dan,

    Hope you're doing well today :slight_smile:

    Unfortunately this can't be done with DM plugin as is, I had a quick chat with the developer about this and it would require coding but here is something to get you started.
    Here is how DM works: in sunrise.php it looks to see if domain from the address bar is already saved into mapping table in db, if it’s there, it finds the relevant blog id and explicitly sets $current_blog to point to the requested blog.
    What you can do is modify this sunrise file and check for the specific page/post, so that mapping takes place only if this post/page is request, otherwise the mapping won’t happen.
    Inside the plugin we have a class that makes sure the mapping conforms to the options selected when creating a mapped domain in the sub-site’s domain mapping settings page.
    You would probably also need to modify the functionality of this class to prevent it from forcing other pages/posts to the mapped domain.

    You might want to try accomplishing it with this plugin:
    https://wordpress.org/plugins/domain-mapping-system/

    If you need further help to customize this then you can post a job in our job board where you can hire a developer to assist further:
    https://premium.wpmudev.org/wpmu-jobs/
    Please note that, no WPMU official staff members are allowed to work in the job board.

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.