We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47401
    • 295 Posts
    Hi

    Does anybody where abouts the context settings are in v2.3.1? I cant find them anywhere, and add ons that refer to settings ->context is not the correct place in the new version.

    please advise.

    Thanks
      • 38723
      • 165 Posts
      You just right click on the context name in the resource tree and click "edit context"

        • 47401
        • 295 Posts
        Hi

        Thanks for your help

        When contextrouter referrs to:

        2. Make sure your contexts have http_host context settings set.
        3. (optional) Assign http_host_aliases context settings where needed to alias other hosts.

        What do I need to do to ensure that contectrouter is setup correctly?
          • 38723
          • 165 Posts
          Quote from: comp_nerd26 at Sep 24, 2014, 08:55 AM
          Hi

          Thanks for your help

          When contextrouter referrs to:

          2. Make sure your contexts have http_host context settings set.
          3. (optional) Assign http_host_aliases context settings where needed to alias other hosts.

          What do I need to do to ensure that contectrouter is setup correctly?

          Having never needed to use context router before, I couldn't be 100% sure. But for the item "Make sure your contexts have http_host context settings set.", my guess would be that when you go into edit context settings you need to add a new setting called "http_host" for each context you're setting up.

          I've never needed to use http_host or http_host_aliases for individual contexts, but whenever I've used additional contexts before I have had to add "base_url" for contexts that are part of a single domain (e.g - if you're using contexts for multilingual sites), "site_start" (give it the page ID that's the homepage for the context), and "site_url" for the context.
            • 47401
            • 295 Posts
            Hi

            Thanks for your reply.

            The http_host_aliases from the contextrouter, allows you to use multiple domains using only 1 context. rather than setting up different contexts for different websites, the contextrouter allows me to use domain1.com and domain2.co.uk to point to the same location hence this is exactly what i need the modx site to do.
              • 47401
              • 295 Posts
              the only problem being is that the http_host doesnt seem to be dynamic, so Im relying on a bit of php code to get the HTTP_HOST using the global $_SERVER variable
                • 38723
                • 165 Posts
                Quote from: comp_nerd26 at Sep 29, 2014, 04:52 AM

                The http_host_aliases from the contextrouter, allows you to use multiple domains using only 1 context. rather than setting up different contexts for different websites, the contextrouter allows me to use domain1.com and domain2.co.uk to point to the same location hence this is exactly what i need the modx site to do.

                If you're pointing more than one domain at the same place, would it not be easier/make more sense to park those domains on top of each other (if it's cPanel based hosting), or do a rewrite rule in .htaccess?
                  • 47401
                  • 295 Posts
                  HI

                  Thanks for your reply. No, ive configured apache in Linux to do this.