WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Does this also map child pages?

[Resolved] Does this also map child pages?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author deniaz
    Member

    @deniaz

    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?

    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/

    Thanks! Much appreciated.

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

    Todd
    Member

    @toddneufeld

    Your edit helped me too. Thanks!

    Crest Web Services
    Member

    @crest-web-services

    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.

    Crest Web Services
    Member

    @crest-web-services

    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Does this also map child pages?’ is closed to new replies.