We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11429
    • 90 Posts
    great, i still have one issue though making sub.domain.com an alias of domain.com

    i don’t want to use redirect 301 because that would tell the search engine that it permanently has been moved, so far my hosting CP does not have anything that can help me to make it an alias

    they have 3 options domain alias, server alias and add cname, i think because in the dns it shows * domain.com i can add a word by typing it in the URL not sure if that makes it an alias
      • 8740
      • 36 Posts
      Would be cool to have one engine, domains, subs that had their own content so xxx.yyy.com wouldn’t be able to change the template aaa.bbb.com or www.yyy.com.
      That might be a big core code change to support that.

      But of course if it supported that out of the box - that would be kick ass.
        • 11429
        • 90 Posts
        The hack works nicely, but sure gets messy when adding more subs

        i.e.,

        $domain1 domain.com
        $domain2 www.domain.com

        for every domain you need to add one more for www.

        is there a way to rewrite code for easier management of multiple subs and repeating items ?

          • 33372
          • 1,611 Posts
          Well, this code is more for subdomains (sub1.whatever.com, sub2.whatever.com, etc.) than for multiple full domain names (something.com, something-else.com, etc.). But that wouldn’t be tough to fix if you want to. You could just remove the subdomain part of the host string with something like:

          ...
          $s = $_SERVER['HTTP_HOST'];
          $chunks = explode(".", $s);
          $s = $chunks[1].'.'.$chunks[2];
          ...
          


          Although I think that I would either strip the www (or always add it) in .htaccess rather than deal with that in PHP personally.
            "Things are not what they appear to be; nor are they otherwise." - Buddha

            "Well, gee, Buddha - that wasn't very helpful..." - ZAP

            Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
            • 8740
            • 36 Posts
            Well why not do it in MySQL - Setup a table for a domains, subs for that, Alias cross linking and such. Then just give each domain / sub their own db for their content.
              • 33372
              • 1,611 Posts
              Future versions of MODx will be more multi-site (and multi-language) friendly right out of the box; the code here is for making this work easily using the current version of MODx.
                "Things are not what they appear to be; nor are they otherwise." - Buddha

                "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                • 22098
                • 218 Posts
                Quote from: OpenGeek at Sep 12, 2006, 03:14 AM

                Just a quick FYI on the subject, the next release following 0.9.5 will most-likely contain a solution to this in the form of what I like to call Contexts. This additional organizational structure will allow you to run as many different sites, sub-sites, localized sites, etc. as you want to. Each Context starts with the familiar MODx system settings, which is then merged with a Context-specific set of settings that can supplement and/or override the base settings. Each Context is responsible for it’s own document tree, Contexts can share common documents, and Plugins can even be limited to specific Contexts as well.

                Will this also make it possible to manage multiple front-ends (ie sites) with one MODx CMS backend?

                Olaf
                  • 21883
                  • 1 Posts
                  hi,

                  my first post smiley

                  about having multiple sites... isn’t it possible to just alter the $this->db->config[’table_prefix’] when a users logs in? this way the modx admin will display those pages, settings etc... that are in that tableprefix no? and for the front-end you do the same using a snippet?

                  just an idea...

                  stefan
                    • 13207
                    • 59 Posts
                    "Just a quick FYI on the subject, the next release following 0.9.5 will most-likely contain a solution to this in the form of what I like to call Contexts."

                    Am wondering if this is available as yet? Having one install for multiple separate domains per server would be awesome without having to make all these file modifications.
                      • 22303 MODX Staff
                      • 10,725 Posts
                      This will be part of the 0.9.7 release and using contexts as subdomains within a single MODx database is in final stages of development and moving into testing.