We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26401
    • 247 Posts
    I'm looking to do something that is sort of an opposite to the symlink, the same page to show two different contents.

    I've got a page that has another domain alias, that acts as a landing page.

    I was using contexts, but I've found that a lot of things stopped working, and troubleshooting each thing was taking several hours, so I'd like to try this approach instead.

    The landing page is the only resource I'm loading from the alias domain, so I should be able to use something like this in the index.php file

    /* Setup context mapping */
    $domain = $_SERVER["SERVER_NAME"];
    switch ($domain) {
        case 'my.aliasdomain.com':
            // get modx to render a different resource
            ???
        break;
    }


    I'm not sure what command would get this working though

    Maybe there's a way to use a plugin too, I'm consider that option too.

      • 26401
      • 247 Posts
      Got it figured out

      /* Setup context mapping */
      $domain = $_SERVER["SERVER_NAME"];
      switch ($domain) {
          case 'my.aliasdomain.com':
              // get modx to render a different resource
              $modx->setOption('site_start',103); //id of alias
              $modx->setOption('request_param_id',103); //id of alias
              $modx->setOption('request_param_alias','aliashome'); //name of alias
          break;
      }
      


      it's not ideal, but it's doing the trick smiley