We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14162
    • 67 Posts
    My site has two domains (http://www.hostdomain.com and http://www.aliasdomain.com). My .htaccess is set up to recognise both domains as pointing to the same site and I have the appropriate DNS records set up on my server. This has been working fine up until I upgraded Revo to 2.1.3. Now, the
    [[++site_url]]
    call only displays the www.hostdomain.com even if someone has entered the site from www.aliasdomain.com.

    This causes an issue specifically with Formit, which redirects to www.hostdomain.com/resourceid on submission of a form. This means that the Formit Retriever does not work if someone is using the form on the www.aliasdomain.com address.

    Something is stopping the root URL from recognising the aliasdomain and is defaulting to the hostdomain. Any ideas anyone? I'm stumped.
      • 14162
      • 67 Posts
      I've solved this issue. Line 300 of core/components/formit/model/fihooks.class.php should be amended as follows:

      $url = $this->modx->makeUrl($this->formit->config['redirectTo'],$contextKey,$redirectParams,'full');

      to
      $url = $this->modx->makeUrl($this->formit->config['redirectTo'],$contextKey,$redirectParams,'abs');


      This uses the base_url as opposed to the site_url in the redirect URL, therefore keeping the formit redirect in the same domain session.
        • 3749
        • 24,544 Posts
        I wonder if this would have solved it:

        [[!++site_url]]
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 14162
          • 67 Posts
          Thanks BobRay - but that makes no difference.

          Ps. By the way - I received your book. It's excellent.