We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • @redtoad: Those .htaccess rewrite conditions and rules are almost certainly the problem. I can’t even interpret that mess TBH.
      • 23194
      • 4 Posts
      I made it! Thanks MadeMyDay for you great article!
      Thanks for all ideas and recommendations in this theme Andrey Nagikh, MadeMyDay and any others!
        • 22448
        • 241 Posts
        All,
        I followed this (http://www.modxcms.de/multiple-domains-with-modx.html) tutorial to setup multiple domains on my local CentOS dev box.
        If i include just the content and tvs in the templates everything works. But when i add a ditto call i get the following error:
        Fatal error: Cannot redeclare class prePHx in /home/kiril/workspace/models_evo/htdocs/assets/snippets/wayfinder/includes/phx/phx.pre.class.inc.php on line 11


        Not sure what is trying to redeclare this class or why.
        Has anybody seen this problem?

        Thanks in advance.
        • Does it work when you disable PHx plugin?
            modx and ecommerce pro
            • 22448
            • 241 Posts
            Found a discussion about this earlier in the thread. The solution was to include an additional check for the prePHX class in wayfinder and ditto snippets to force them not to include the phx.pre.class.inc.php file if the class already exists.
              • 23194
              • 4 Posts
              outre99, pls show me how? or give me link to thread.

              Now I found the problem with this solution. MultiDomain and Shopkeeper doesn’t works together.

              1. For Shopkeeper is better to use a PHx plugin, but when i install them MultiDomain doesn’t work. When i switch off PHx, MultiDomain working is ok.
              2. Shopkeeper problems, when MultiDomain is ON:

                <div class="shop-stuff-b">
                  <h3>Mouse</h3>
                  <form action="domain-ru/shop/primer_2index.html" method="post">
                  <input type="hidden" name="shk-id" value="165" />
                    <div class="shs-descr">
                      <img class="shk-image" src="" alt="" height="130" width="130" />
                      <div>Price:<br /> <span class="shk-price"></span> RUB</div>
                      <br />
                      <div></div>
                      <br />
                      <div>Color:<br /></div>
                    </div>
                    <div align="center">
                       <input type="text" name="shk-count" value="1" size="2" maxlength="3" />
                        
                       <button type="submit" name="shk-submit" class="shk-but" style="float:none;">To cart</button>
                    </div>
                  </form>
                </div>
              


              How to correct urls? - <form action="domain-ru/shop/primer_2index.html" method="post">

              ===== add later ===================================

              For #2 i found the great solution from Andrey Nagikh there. Андрей ты мозг! Огромное человеческое Спасибо!
              Only need to change ’code’ of multisite plugin by multiLinks plugin from post #52!

              It remains to solve the problem with the PHx plugin 2.1.4 and MultiDomain!
                • 22448
                • 241 Posts
                @phantomik

                The solution for the PHx parser conflict was to add the class existence check into Ditto and Wayfinder snippets like so:


                if ($phx && !class_Exists("prePHx")) {
                $files[’phx’] = $wayfinder_base.’includes/phx/phx.pre.class.inc.php’;
                }
                  • 22448
                  • 241 Posts
                  Situation:

                  there are 3 domains with roughly the same layout, urls, and templates. Each site has a blog with the same alias. I’m trying to create a single Ditto call to pull content from under the "blog" container. However, Ditto requires id for its &parent’s parameter. I would rather use alias since it’s the same for all sites.
                  Has anybody found a workaround for this?

                  Thanks.
                    • 22448
                    • 241 Posts
                    As described in the post above i needed a way to generalize Ditto calls across multiple domains. The scenario is that the sites look identical, but have different content. For example, every site has a "blog" document containing all of the blog posts. So i needed to call Ditto with &parents=`blog` for the same call to work for all domains. But Ditto requires document id for the &parents parameter. Here’s the solutions that i came up with:

                    getDocId snippet will take a parent id and an alias, and will return the id of the first child of the parent that matches the alias.

                    To install download the attached files.
                    In the backend create a new snippet called getDocId and paste the contents of the getDocId_snippet.txt file into it.
                    Then copy getDocId.php.txt into your snippets folder and rename it to getDocId.php


                    Snippet calls:

                    [[getDocId? &alias=`blog`]] will return the id of the first child document under the current site folder that has alias "blog".

                    [[getDocId? &parent=`999` &alias=`blog`]] will return the id of the first child document of document with id 999

                    Hope it’s helpful to somebody.
                    I’m just starting to work on my first multi-domain site using this technique so i’ll post changes to this snippet as i go along.
                      • 22448
                      • 241 Posts
                      I’m getting a strange problem when trying to include jQuery from CDN like so:

                      <script src="http:/code.jquery.com/jquery-1.6.2.min.js" type="text/javascript"></script>


                      but at run time FireBug shows this:

                      <script src="http:/code.jquery.com/jquery-1.6.2.min.js" type="text/javascript">
                      1Failed to load source for: http://pav-thai-model-dev.net/code.jquery.com/jquery-1.6.2.min.js
                      </script>


                      so it appears that the src url get’s overwritten with the site domain, but it shouldn’t.

                      However,
                      serving a local copy of jquery from assets/js works fine.

                      Has anybody seen this before?
                      Any ideas of why it’s happening?