WordPress.org

Ready to get started?Download WordPress

Forums

Domain Mapping System
[resolved] Does this also map child pages? (7 posts)

  1. Maxaud
    Member
    Posted 1 year ago #

    I'm curIous if this plugin works for child pages too.

    Ex: domain.com/page/child becomes mapped.com/child

    Thanks!

    http://wordpress.org/extend/plugins/domain-mapping-system/

  2. deniaz
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Maxaud,

    Haven't tried it out myself but I don't see a reason why it shouldn't work.
    If you find time to test it, would you mind reporting back?

  3. Chris Cash
    Member
    Posted 1 year ago #

    To map specific pages you will need to edit the file domain-mapping-system/dms.class.php using the plugin editor and change the code as follows in private function setCurrentDomain()

    Find:

    $this->domain    = $_SERVER["HTTP_HOST"];

    Replace with:

    if ($_SERVER["REQUEST_URI"]=='/') {
         $this->domain    = $_SERVER["HTTP_HOST"];
    } else {
         $this->domain    = $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
    }

    Also, in the plugin settings, make sure to include a trailing slash "/" after the specific page name in the url. Example: domain.com/page/

  4. Maxaud
    Member
    Posted 1 year ago #

    Thanks! Much appreciated.

  5. uudens
    Member
    Posted 1 year ago #

    The code from Chris Cash works great! It took me a while to find it, author might consider adding this to plugin description

  6. toddneufeld
    Member
    Posted 6 months ago #

    Your edit helped me too. Thanks!

  7. Crest Web Services
    Member
    Posted 6 months ago #

    I can confirm that Chris's code edit above makess mapping sub pages possible.

    This would be a great addition to your plugin.
    This allows people to make a microsite with more than one page.

    Lets say your main site is http://www.widgets.com
    You want to make a training website for showing customers how to use your widgets.
    For this, you purchased http://www.widgettraining.com

    Rather than install a whole new WordPress site or enabling a multisite for this, we could just use your plugin to route the new doamain's traffic to a specific page on widgets.com

    With the default plugin functionality you could map the domain:
    http://www.widgettraining.com
    to route traffic to
    http://www.widgets.com/training

    With chris's edit above, you can map sub pages to expand the microsite like mapping:
    http://www.widgettraining.com/widget-a/
    to:
    http://www.widgets.com/training/widget-a/

    With body class CSS and page templates, you can then give the look and feel of an entirely different site on the same installation of WordPress.

    Add the following plugin to change the nav menu per page:
    http://wordpress.org/plugins/ce-wp-menu-per-page/

    As a reminder, you need to add www versions of your mappings to cover all traffic routes.

  8. Crest Web Services
    Member
    Posted 6 months ago #

    I can confirm that Chris's code edit above makes mapping sub pages possible.

    This would be a great addition to your plugin.
    This allows people to make a microsite with more than one page.

    Lets say your main site is http://www.widgets.com
    You want to make a training website for showing customers how to use your widgets.
    For this, you purchased http://www.widgettraining.com

    Rather than install a whole new WordPress site or enabling a multisite for this, we could just use your plugin to route the new doamain's traffic to a specific page on widgets.com

    With the default plugin functionality you could map the domain:
    http://www.widgettraining.com
    to route traffic to
    http://www.widgets.com/training

    With chris's edit above, you can map sub pages to expand the microsite like mapping:
    http://www.widgettraining.com/widget-a/
    to:
    http://www.widgets.com/training/widget-a/

    With body class CSS and page templates, you can then give the look and feel of an entirely different site on the same installation of WordPress.

    Add the following plugin to change the nav menu per page:
    http://wordpress.org/plugins/ce-wp-menu-per-page/

    As a reminder, you need to include www and non-www versions of your mappings to cover all traffic routes.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic