We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Quote from: towerofbabel at Jun 08, 2009, 02:46 PM

    if I follow the exact steps outlined on that page [ http://svn.modxcms.com/docs/display/revolution/Using+One+Gateway+Plugin+to+Manage+Multiple+Domains ], starting from "Alternatively...", I get 404 document not found.

    I did this at work, on the latest version of xampp, default config, on windows XP. At home I am on mac using MAMP - I’ll try that too.

    I don’t see anything on the linked to page about updating apache settings. on XAMPP, I am not creating additional virtual hosts, every "domain" is just localhost/domain1/ ; localhost/domain2/; etc.
    Yeah, that’s not going to work. In order to use the alternative instructions, you need to be able to point specific host names to specific document roots, which requires web server configuration. This is going to be specific to whatever web server environment you choose to deploy on. If you do not know how to do that, I suggest using the plugin method with the single, standard modx gateway controller (i.e. index.php).
      • 30497
      • 245 Posts
      Quote from: OpenGeek at Jun 08, 2009, 04:03 PM

      Quote from: towerofbabel at Jun 08, 2009, 02:46 PM

      if I follow the exact steps outlined on that page [ http://svn.modxcms.com/docs/display/revolution/Using+One+Gateway+Plugin+to+Manage+Multiple+Domains ], starting from "Alternatively...", I get 404 document not found.

      I did this at work, on the latest version of xampp, default config, on windows XP. At home I am on mac using MAMP - I’ll try that too.

      I don’t see anything on the linked to page about updating apache settings. on XAMPP, I am not creating additional virtual hosts, every "domain" is just localhost/domain1/ ; localhost/domain2/; etc.
      Yeah, that’s not going to work. In order to use the alternative instructions, you need to be able to point specific host names to specific document roots, which requires web server configuration. This is going to be specific to whatever web server environment you choose to deploy on. If you do not know how to do that, I suggest using the plugin method with the single, standard modx gateway controller (i.e. index.php).

      Excuse all the questions - I deal with a lot of related issues daily, but at the end of the day I am not a programmer, and there are gaps in my knowledge.

      So, what you say about server config, sounds just like a normal shared hosting scenario... or do you mean something else?

      For instance, on dreamhost I have www.domain1.com which points to /home/username/domain1.com/ (or anything I choose to call it), and www.domain2.com which points to /home/username/domain2theblog/

      Are you saying the "alternative method would work in this scenario? Or perhaps it is not enough info...

      The problem with the plugin method, from the way I read it, is all files are in a single context - I need the convenience of separate contexts, I think, or things will get messy quickly.

        • 5576
        • 31 Posts
        Quote from: OpenGeek at Jun 08, 2009, 04:03 PM

        Yeah, that’s not going to work. In order to use the alternative instructions, you need to be able to point specific host names to specific document roots, which requires web server configuration. This is going to be specific to whatever web server environment you choose to deploy on. If you do not know how to do that, I suggest using the plugin method with the single, standard modx gateway controller (i.e. index.php).

        Why is it not going to work? because it’s a subfolder? Is it only possible to handle different domains (and probably subdomains) with this method?

        I have a domain say myDomain.net which contains many different sites: myDomain.net/site1/ , myDomain.net/site2/
        I want to manage the resources centrally while keeping the contents and users of the different sites separete.
        Maybe I can acomplish that using only virtual subfolders and with use of priviledges, roles and contexts?
          bringing MODx to the hispanians
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: coCoKNIght at Jun 15, 2009, 05:31 PM

          Why is it not going to work? because it’s a subfolder? Is it only possible to handle different domains (and probably subdomains) with this method?

          I have a domain say myDomain.net which contains many different sites: myDomain.net/site1/ , myDomain.net/site2/
          I want to manage the resources centrally while keeping the contents and users of the different sites separete.
          Maybe I can acomplish that using only virtual subfolders and with use of priviledges, roles and contexts?
          Right, the separate index.php per context is only for use where you can configure specific virtual hosts in your web server for specific domains. Otherwise, the method of switching contexts virtually through a single gateway should serve you better.
            • 24935
            • 160 Posts
            This is the reason for the 404 error...

            Here is the scenario. You have a shared hosting account with several addon domain and/or subdomains. Each addon domain (or subdomain) has a folder which is the "document root" for that domain (or subdomain).

            So you have a public_html folder for your main domain, and perhaps your host creates a folder within that for each addon domain, so you also have something like this:
            public_html/ (doc root for main site)
            public_html/addondomain1.com/ (doc root for first addon domain)
            public_html/addondomain2.com/ (doc root for second addon domain)
            public_html/somesubdomain/ (doc root for a subdomain)

            Lets say you install revolution in public_html/addondomain1.com/ and it is working fine. Then, in the manager, you create a second context called web2, and make a couple documents in that context.

            Next you copy index.php, core.config.php (and .htaccess if you have friendly urls) to public_html/addondomain2.com/ and faithfully edit index.php like this:
            $modx->initialize('web2');
            


            You think everything will be great, but when you go to www.addondomain2.com you get a 404. Why? Well, MODx will load the page identified in the site_start setting. Site start, of course, points to a document in the FIRST context. The second context doesn’t have access to that document, so you get a 404.

            The solution is to override the site_start setting in the second context. To do this, right click on the context and select "edit context." There you can add a new conext setting. So add a setting with the key site_start and set it to the id of one of the pages in the second context. Then it will work. Be sure to do the same for the error_page setting and any other settings that are specific to that site.

            I had this same problem...could someone update the wiki with this info?
              • 5576
              • 31 Posts
              thanks rfoster
              that is some super useful information
                bringing MODx to the hispanians