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

    I followed the instructions in the Revolution wiki re: creating the multiple domains in one gateway plugin, and I have created all of the contexts to match the domains and pointed the domains correctly to the right directory on the server. I also set the plugin to trigger on OnHandleRequest.

    Problem: for some reason, no matter what I do, only the ’web’ context will be called up, no matter which domain I come from. It’s as if the plugin isn’t doing anything/being called. There is nothing in the logs that indicates an error of any sort. I’ve checked the syntax repeatedly in the plugin. I’ve played around with adding context parameters as described in the subdomains instructions as well as without. A note on that: the second option using different directories for each context’s domain works. It’s just the plugin method of managing domains/contexts that doesn’t work.

    Any ideas? I’m stumped.

    on: revolution 2.0.0.pl
      • 3749
      • 24,544 Posts
      I’ve tried it and it definitely works.

      If you used the other method first, there may be some things you have to undo.
        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
        • 5206
        • 10 Posts
        As is always the case, it was something right in my face:
        For development/testing purposes, I had set it all up to be under subdomains, but in the plugin, I had only listed sub.domain.tld:80 in the first case, and then domain.tld in the second. once I added the subdomain to the second case then it was fine.

        a note for anyone out there who is fiddling around with this late at night when your brain is half gone, you still need to define your site_start for your individual contexts.
          • 5206
          • 10 Posts
          One of the setups that I’ve got now will have users taking advantage of the adminLite-type level of priviledges who will be able to edit a specific group of contexts. Everything is coming together surprisingly well given it’s my first attempt at doing this... however... the issue I’ve come accross is controlling images/files and their placement in reference to the subdomain version of multiple domains setup -- i.e. when creating an instance of index.php/config.php/etc. in a different directory with a reference to core.

          I want it to be that the adminLite can place images in an images directory and files in a files directory that is in the subdir the domain references in on and generally has no access to core’s actual file structure.

          example:
          ~/revoinstance
          ~/subdomaindir <-- where the subdomain points to and the base of filebrowsing in the manager for adminLite user.
          ~/subdomaindir/images
          ~/subdomaindir/files

          The adminLite goes to: core.domain.com to edit the contexts.
          when he wants to upload images (for example, through the tinymce plugin)
          I want the filebrowser base to start at ~/subdomaindir so it’s obvious where the images should be placed, vs files.
          What I tried: I edited the adminLite user and gave them a custom filemanager_path: ../subdomaindir
          That made all filebrowsing go to the subdir, which was great, but when an image was actually placed through tinymce’s image function, the src url was: "../subdomaindir/images/image.jpg" which obviously doesn’t work.
          how do I fix that?

          thanks!
            • 3749
            • 24,544 Posts
            You need context settings for each context for base_url and site_url.

            Having

            <base href="[[++site_url]]" />


            in the head section of all templates may solve things. If not, you can always reference your images with something like this:

            <img src="[[++base_url]]assets/images/image.jpg]]"> 
              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
              • 33976 ☆ A M B ☆
              • 571 Posts
              Hi,

              i didn’t work with this yet, but i’ll definitely do soon.
              Anyway, you might be interested in setting up
              [[++assets_path]]
              too for each context.

              I hope it’ll help you a bit. Let us know your workaround smiley

              Cheers
                • 25054
                • 8 Posts
                If I understood chrismed correctly, I’m having a similar problem. I host modx at, say, aaa.com and want to use it to manage bbb.com. Simple enough if I create a bbb context and start creating resources under it, and it’s working (fantastic, for my needs). The problem is, I want my images to be stored at bbb.com/assets/images and not aaa.com/assets/images (the default path for the Resources Browser). I though that this could be done simply by overriding some system settings for the bbb context:

                filemanager_path = /usr/www/users/me/bbb/
                rb_base_url = http://www.bbb.com/assets/
                rb_base_dir = /usr/www/users/me/bbb/assets/

                Of course all the assets folders exist at the bbb folder in the server.

                But the resource browser isn’t respecting my settings, it just uses the default (web) settings. Shouldn’t it use the bbb settings when I edit a resource under the bbb context?
                  • 3749
                  • 24,544 Posts
                  Did you set those as Context Settings?
                  Did you also create Context Settings for base_url and site_url?
                  Did you clear the site cache and your browser cache/cookies?
                  Dir you visit the site from another browser where you’re not logged into the Manager?

                  If yes to all, then it’s probably a bug.
                    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
                    • 5206
                    • 10 Posts
                    sounds like we’re having the same issue. I actually had to bail on trying to get it working for a while and temporarily dumped all of my files back into the root directory, as I was contending with a 404 problem that was getting more in my way.

                    BTW if anyone is getting multiple but not constant 404s when using the gateway plugin, I solved this problem by using the tutorial mentioned in this thread:http://modxcms.com/forums/index.php/topic,42858.msg256335.html#msg256335. for some reason dumping the context resolver into the index.php file directly, rather than using the plugin solved the problem. Not as glamorous and all-powerful (since it means you have to edit separate index.php’s if you’re hosting through multiple directories), but it works. I have no idea why, or why the plugin was having problems.

                    Now that it is running otherwise smoothly, I’ll be getting back to this, as it is pretty crucial in the long run. Bob, thanks for the criteria! I will report back after some testing.
                      • 3749
                      • 24,544 Posts
                      One possible cause of intermittent 404 errors is having some requests come in as www.site.com and others as site.com. There’s a section in the root .htaccess file that will force them to one or the other, which might help.
                        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