We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42562
    • 1,145 Posts
    In your template, try this <base href="[[!++site_url]]" />. I think you are using the same template? Anyway, call that site_url uncached (!), so that the switch is made smoothly, from one context to another...
      TinymceWrapper: Complete back/frontend content solution.
      Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
      5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
      • 42502
      • 12 Posts
      its already with !
      i've even switch off whole cache'ing system to test if it change anything and ... no.

      is there any way to change site_url manualy?
      i was trying doing it in core/config.core.php but $site_url in config.core.php was diferent that $modx->config['site_url']

      maybe teher is a way to change $modx->config['site_url'] on page load or something?
        • 42502
        • 12 Posts
        ok i have it. of i diddnt mend but ... script works smiley

        i have snippet:

        <?php
        $site_url= ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port) ? 'https://' : 'http://';
        $site_url .= $_SERVER['HTTP_HOST'];
        if ($_SERVER['SERVER_PORT'] != 80)
            $site_url= str_replace(':' . $_SERVER['SERVER_PORT'], '', $site_url); // remove port from HTTP_HOST  
        $site_url .= ($_SERVER['SERVER_PORT'] == 80 || (isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port) ? '' : ':' . $_SERVER['SERVER_PORT'];
        $site_url .= $base_url."/";
            
        $modx->config['site_url'] = $site_url;
        return  $modx->config['site_url'];


        and use it intead of [[!++site_url]]

        its doing the job smiley
          • 42562
          • 1,145 Posts
          If I could fully understand the scenario:
          Are you using multiple templates?

          Better not to touch the core. You can create your own placeholder if you need something custom.
          System Settings / Create New Setting

          You don't even have to use the [[++site_url]] at all
          Call yours
          [[++mainsite_url]] (witha value of main-url)
          [[++kubasite_url]] (with a value of sub-domain-url)
          [[++moresite_url]] (with a value of sub-domain-url)

          Your wayfinder links work just fine from here. It respects the sub-domains before and after refreshing. Perhaps the main logo and other fixed things need to point to destino.pl? Right now the main logo is pointing to the current sub-domain. Should be easy to fix. [ed. note: donshakespeare last edited this post 11 years, 2 months ago.]
            TinymceWrapper: Complete back/frontend content solution.
            Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
            5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
            • 42562
            • 1,145 Posts
            I am glad you found the solution!
              TinymceWrapper: Complete back/frontend content solution.
              Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
              5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
              • 42502
              • 12 Posts
              than you!
              will try with placeholders

              logo ... i knw it's strange but i have to tolk to client. i can't remember now but it may be that idea is to have separated logos for each subdomain.