We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3698
    • 57 Posts
    Hi all,
    I use a service menu in the top part of the website with most links "Contact", "Sitemap" etc which point to resources of the default web context. But one of those links points to an other context (login page of the intranet subdomain). Because the entries in this service menu will not change I have not used Wayfinder for menu building but used this code instead:

    <ul>
    <li><a href="[[~6]]">Kontakt</a></li>
    <li><a href="[[~7]]">Gästebuch</a></li>
    <li><a href="[[~8]]">Sitemap</a></li>
    <li><a href="[[~9]]">Impressum</a></li>
    <li><a href="[[~30]]">Intern</a></li>
    <li><a href="[[~11]]">English</a></li>
    </ul>

    This works when used in the web context. The [[~30]] link, which points to the Intranet context, works as well and loads the login page of the subdomain. But from there all links seem to refer to the subdomain context which is the wrong URL for most of them.

    How can I link properly between the domain and the subdomain?

    -Andrea
      • 22303 MODX Staff
      • 10,725 Posts
      Make sure you set a specific site_url and base_url for the main web context as well.
        • 3698
        • 57 Posts
        Quote from: OpenGeek at Nov 14, 2010, 05:10 PM

        Make sure you set a specific site_url and base_url for the main web context as well.

        Thank you - that solved the problem!

        -Andrea
          • 2807
          • 20 Posts
          Quote from: OpenGeek at Nov 14, 2010, 05:10 PM

          Make sure you set a specific site_url and base_url for the main web context as well.

          I am having a similar problem but have set the following;

          Main ’web’ Context:
          base_url /
          site_url foo.org


          SubDomain ’dev’ Context:
          base_url /
          site_url dev.foo.org

          Everything else works correctly. Linking from ’web’ -> ’dev’ creates no problems, but vice versa ’dev’ -> ’web’ produces blank entries i.e.
          <a href="[[~##]]">Test Link</a>
          when viewing source results in
          <a href="">Test Link</a>


          I’m probably being st00pid here and base_url should be different?

          Any pointers most appreciated,
          Dave
            • 22303 MODX Staff
            • 10,725 Posts
            Your site_url values are wrong. site_url must always be the complete URL, including the scheme, http_host, and base_url, e.g. if base_url is /modxishere/ and scheme is http:// and http_host is domain.tld, then site_url must be http://domain.tld/modxishere/
              • 2807
              • 20 Posts
              Quote from: OpenGeek at Jan 28, 2011, 09:52 AM

              Your site_url values are wrong. site_url must always be the complete URL, including the scheme, http_host, and base_url, e.g. if base_url is /modxishere/ and scheme is http:// and http_host is domain.tld, then site_url must be http://domain.tld/modxishere/

              Thank you for your prompt reply. Here is a breakdown of my dir structure to help clarify (I should probably have done this originally, please excuse my muddled brain, long days, short nights wink

              /srv/www/foo.org
                         |
                         +-- .htaccess
                              assets
                              config.core.php
                              connectors
                              core
                              index.php
                              manager
              
              /srv/www/dev.foo.org
                         |
                         +-- .htaccess
                              config.core.php
                              index.php
              


              With the appropriate apache configurations for each listed as (where the name of the site *is* the name of the dir/DocumentRoot);

              'web' context
              DocumentRoot /srv/www/foo.org
              
              'dev' context
              DocumentRoot /srv/www/dev.foo.org
              


              ’dev’ -> index.php has also been edited;

              /* Initialize the default 'web' context */
              $modx->initialize('dev');
              


              And both ’web’ and ’dev’ .htaccess files contain;

              RewriteEngine On
              RewriteBase /
              


              This is being run with Apache/2.2.9 - (Debian, Lenny)

              Is this setup correct?

              Again thank you for time, patience and answers. I learn pretty quick, and may I say that MODx is an *excellent* example of how a CMF/CMS should work.

              Dave
                • 22303 MODX Staff
                • 10,725 Posts
                ??? The only problem is the site_url value in your web Context. Fix that as I advised, and you will fix the problem.
                  • 2807
                  • 20 Posts
                  Thank you so much OpenGeek!

                  It now works. I have not as yet applied ’friendly URLs’ to this dev site but I hope all will continue to be well.

                  Many kind regards,
                  Dave