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

    I have domains on one server with the same IP address, but in different directories (virtual domains?):

    /same/same/domains/maindomain.com/public_html/ - modx install here
    /same/same/domains/domain2.com/public_html/ - copies of .htaccess, index.php and config.core.php with correct path to root with modx

    I use one of contexts routing plugins (XRouting) and there are no problems when I make a virtual folder /lang/ or make domain2.com as alias to maindomain.com - everything functions as expected. But the problem is, that I can't point domain2.com as alias to maidomain.com, since I need some domain2.com independence - create separate emails, have its own physical folders - and my hosting provider doesn't let to do this if the domain is set up as pointing/alias.

    What I did so far is I put .htaccess, index.php and config.core.php to domain2.com/public_html/. The correct context loads under domain2.com. Friendly urls seems to function, pages load, but what doesn't function are paths - since paths are based on base_url, no /style/, /js/ or even /assets/ folders contents display because they are not physically on domain2.com/public_html/

    Of course I could indicate in templates full url addresses for /styles/ or /js/ folders, but for /assets/ folder this doesn't work (when referenced not in the templates). Neither can I set up paths for Media Sources to work in domain2.com

    So my question is - how to set up modx multidomain install when domains are on the same server but are not aliases? Is this possible? What else needs to be changes besides putting .htaccess, index.php and config.core.php in domain2.com root?

    I also have found that in this case I can't see (as Administrator) the domain2.com context when the site is offline, so probably not only paths problems must be solved.

    But I really don't know where to start the search for solution for contexts of domains that don't point to modx root.

    Revo 2.4.3

    Thank you.
      • 31837
      • 59 Posts
      Hi treniota,
      Firstly, I'll say I'm no expert this area, however, I have tried it with subdomains at one stage. So I can really only point you in a rough direction.
      Here's a couple of documents that may help you out I found online. What you're trying is very possible though.

      http://forums.modx.com/index.php?action=thread&thread=67558&i=1

      https://rtfm.modx.com/revolution/2.x/administering-your-site/contexts/using-one-gateway-plugin-to-manage-multiple-domains

      http://www.belafontecode.com/modx-revolution-hosting-multiple-domains/

      The last one is probably the most helpful though.

      Cheers,
      Steve
        • 51907
        • 8 Posts
        Thank you for answer.

        All these tutorials are based on premise:

        "Preparation:
        The top-level domains that you wish to use should already be pointed to/parked on the server where Revo is installed. Do this the same as you would with setting up hosting or parking for any domain."

        "Make sure your parked domains are directed to your public_html folder."

        "This tutorial is based on the assumption that all domains that shall be served by this MODx Revolution installation are pointing to one and the same directory/the same document root on your web server, e.g. /var/www/localhost/htdocs or /var/www/localhost/modxrevomulti or a corresponding path on other operating systems."



        But as I mentioned I don't have problems, when domain2.com points to domain1.com, I have problems when it doesn't:

        "But the problem is, that I can't point domain2.com as alias to maidomain.com, since I need some domain2.com independence"