We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3093
    • 45 Posts
    Hello all,

    I have MODX 2.2.13 with a multi-context setup based on the method of using individual folders for the contexts, each with their own .htaccess and index.php. I recently added a new context, setting it up just as I had the others (which are working perfectly, by the way). However, when $modx->initialize('newcontext') is called in the new context's index.php, the 'web' context is loaded instead, without fail! If I change it to initialize one of the other contexts, that works, and if I change it to a context that doesn't exist, it gives a PHP error. So there's something going on inside of MODX with my new context.

    I'm at a loss as to why it won't initialize the new context. I have site_start defined (as a page in the context), as well as http_host, site_url, base_url, etc. Any ideas why this might be happening and how I can remedy it?

    Thanks!
      • 26681 MODX Staff
      • 123 Posts
      I would take a look at the cache files for each context. Not sure what you'd find there, but if there's something strange/different in the new context, that might point you in the right direction.

      Also, I'm assuming you've checked the .htaccess file in the new folder, and the config.core.php yes?
        [sepiariver.com] (https://sepiariver.com/)
        • 3109 ☆ A M B ☆
        • 894 Posts
        I always suggest doing multi-context sites with ContextRouter it's much easier and it will help you avoid having to do anything in .htaccess and all plugins will work across contexts.

        If the documentation doesn't get you where you need to be check out my ContextRouter review.

        If you do plan to use ContextRouter you will need to undo all your changes to .htaccess and the index.php files you created.

        Good Luck.
          Benjamin Marte
          Interactive Media Developer
          Follow Me on Twitter | Visit my site | Learn MODX