We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10666
    • 68 Posts
    Has anyone succeeded in making this work with 0.9.5 ? sad
    (or have a good alternative?)
      • 33372
      • 1,611 Posts
      The plugin that I quoted above works in 0.9.5.
        "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
        • 10666
        • 68 Posts
        Hi ZAP ! I’ve re-read your post and just figured out that I have to use :
              <base href="http://subdomain.domain.com/" /> 
        in the template of the pages that I want to belong in that domain.I haven’t actually thought of that until now , and that’s the reason the plugin was outputting bad links on page laugh .
        I was wondering , what is actually the difference between your plugin and the original start ? ( I see you removed the site_start and error from being customized.Is that all ?),
          • 33372
          • 1,611 Posts
          The logic that I used is just a more simplistic implementation of the same idea (not a new plugin). Instead of changing the site start and error page values in general I only forward to the Spanish home page when the English home page would be loaded but the domain name is the Spanish version (doesn’t sound so simple when I say it that way, but it is). The original logic is designed to affect the site start and error pages over the whole site, so use that if you need more than a simple forward.
            "Things are not what they appear to be; nor are they otherwise." - Buddha

            "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

            Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
            • 10666
            • 68 Posts
            Thank you! I’ve got it now tongue . Any news if the context thing will get into 0.9.7 ?
              • 25663 MODX Staff
              • 12,272 Posts
              Contexts are absolutely in 097, though I don’t know about implementing subsites/subdomains/multiple domains.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 10666
                • 68 Posts
                I’ve noticed that when using subdomains on a modx website , QuickEdit no longer works on the pages on the subdomain. Am I the only one experiencing this behavior or can someone else confirm this issue ?
                  • 11429
                  • 90 Posts
                  Am I getting this right ?

                  By making sub.domain.com an alias of www.domain.com

                  The sub.domain would share the same content with www.domain but using this plugin the sub.domain would be directed to the specified page ?

                  Is this how it works ? and if so will it mess anything up mixing the two ?

                  just tested it locally works like a gem fantastic, now how does google look at sub.domain.com that are alias to domain.com ?

                  Do they both still get counted as separate ?

                  I notice there are some issues that present themselves when using this for example, site_url and site_name everything defaults to the primary domain,

                  It would be great if something like this was well intergrated into modx, the amount of time it would save not having to create multiple modx installs, not to mention all the styling/template issues you may come accross for different styles.

                  this plugin is still doable but much customization would be needed for each sub

                  would the multiple domains plugin work better in the case of subdomains ? since they are treated as independant domans
                    • 11429
                    • 90 Posts
                    Code:
                    $e = &$modx->event;
                    $subdomain = 'subdomain.yourdomain.com'; // your subdomain name here
                    if($e->name=='OnWebPageInit') {
                       $s = $_SERVER['HTTP_HOST'];
                       if($s==$subdomain && $modx->documentIdentifier==$modx->config['site_start']){
                          header('Location: index.php?id=6');
                          exit;
                       }
                       else if($s==$subdomain){
                           $modx->config['site_start'] = 6; // your start page here
                           $modx->config['error_page'] = 6;	// your error page here
                       }
                    }


                    is there a way to add multiple sub.domains to this ?
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Add more subdomains, $subdomain1, $subdomain2, etc...

                      Then either convert the if statements into a switch, or just add if... elseif.... statements to check the $s == condition against each of the subdomains.
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org