We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17507
    • 2 Posts
    I’ve just installed MODx 0.9.1 and am having a problem with the domain being identified by as the base_url (or is that base_path?)

    My domain (let’s say www.<vanity-domain>.com) is actually hosted at www.<real-domain>.com/subdir with a URL masking feature to make the whole deception look invisible. When I type in www.<vanity-domain>.com, MODx detects the ’real’ server root on <real-domain>.com and tries to find its assets at www.<vanity-domain>.com/subdir/assets instead of www.<real-domain>.com/subdir/assets.

    I’ve thought to hack the base variables manually into /manager/includes/config.inc.php, but without success. I also read something about using base_url reference in the document templates, but also to no avail.

    I’m running in a fairly standard LAMP environment. My current workaround is putting a dirty symlink in the filesystem, which is far from ideal!

    Hope that makes sense. Grateful for any advice.
      • 22303 MODX Staff
      • 10,725 Posts
      base_url is the URL from the webserver root to the physical directory where the contents are stored.

      base_path is the absolute path from the root path the user has access to

      site_url is the protcol + fully qualified domain name + base_url

      However, can you explain how you are redirecting users from the real domain to the vanity domain? URL masking?
        • 32963
        • 1,732 Posts
        All you have to do is add the following to the bottom of your config.inc.php file

        $base_url='<your /url to your site>';
        $base_path='<your /physical_path to your site>';
        $site_url='<your www.vanity-domain.com>';
          xWisdom
          www.xwisdomhtml.com
          The fear of the Lord is the beginning of wisdom:
          MODx Co-Founder - Create and do more with less.
          • 17507
          • 2 Posts
          Guys
          Sorry for the delay getting back on this, but hey - a massive thankyou for the clarification and the hint about modifying the config.inc.php I finally got there with the right combination of trailing slashes and ’Use friendly alias path’ setting.

          Course I now have more questions, but will start a new thread when I decide I really can’t figure them out myself. Keep up the great work!
            • 44776
            • 5 Posts
            Going to update this thread as its a similar topic

            Having issues with moving a site and trying to follow most of the instructions on this forum. I know enough to be dangerous - but not enough to not need help!

            I am working in config.inc.php and am getting this error:

            -----------

            « MODx Parse Error »

            MODx encountered the following error while attempting to parse the requested resource:
            « PHP Parse Error »

            PHP error debug
            Error: include_once(/home/campasano/public_html/assets/plugins/phx/phx.parser.class.inc.php) [function.include-once]: failed to open stream: No such file or directory
            Error type/ Nr.: Warning - 2
            File: /home/campasano/gotrecruited.com/manager/includes/document.parser.class.inc.php(746) : eval()'d code
            Line: 10

            Parser timing
            MySQL: 0.0039 s (3 Requests)
            PHP: 0.0364 s
            Total: 0.0402 s

            --------------

            I make the change to the file and added

            $base_path='</home/campasano/gotrecruited.com>';
            $site_url='<http://www.gotrecruited.com>';

            above

            if (!defined('MODX_BASE_PATH')) define('MODX_BASE_PATH', $base_path);
            if (!defined('MODX_BASE_URL')) define('MODX_BASE_URL', $base_url);
            if (!defined('MODX_SITE_URL')) define('MODX_SITE_URL', $site_url);
            if (!defined('MODX_MANAGER_PATH')) define('MODX_MANAGER_PATH', $base_path.'manager/');
            if (!defined('MODX_MANAGER_URL')) define('MODX_MANAGER_URL', $site_url.'manager/');

            in the config.inc.php

            and when I do I get this error:

            ----------

            Warning: include_once(</home/campasano/gotrecruited.com>manager//includes/document.parser.class.inc.php) [function.include-once]: failed to open stream: No such file or directory in /home/campasano/gotrecruited.com/index.php on line 112

            Warning: include_once() [function.include]: Failed opening '</home/campasano/gotrecruited.com>manager//includes/document.parser.class.inc.php' for inclusion (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear') in /home/campasano/gotrecruited.com/index.php on line 112

            Fatal error: Class 'DocumentParser' not found in /home/campasano/gotrecruited.com/index.php on line 113

            ____________

            I am scratching my head on what I can do to make this work.
            Any help would be greatly appreciated!!
              • 3749
              • 24,544 Posts
              The post above is kind of misleading.

              Try this (no < or >) :

              $base_path='/home/campasano/gotrecruited.com/';
              


              Actually, you shouldn't need to manually set the $site_url value, it's computed using the MODX_BASE_URL.
              [ed. note: BobRay last edited this post 13 years, 2 months ago.]
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 44776
                • 5 Posts
                Thanks BobRay -

                Made the change and now I received a whole new error....looks like the path still isn't right...

                Warning: include_once(/home/campasano/gotrecruited.commanager//includes/document.parser.class.inc.php) [function.include-once]: failed to open stream: No such file or directory in /home/campasano/gotrecruited.com/index.php on line 112

                Warning: include_once() [function.include]: Failed opening '/home/campasano/gotrecruited.commanager//includes/document.parser.class.inc.php' for inclusion (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear') in /home/campasano/gotrecruited.com/index.php on line 112

                Fatal error: Class 'DocumentParser' not found in /home/campasano/gotrecruited.com/index.php on line 113
                  • 3749
                  • 24,544 Posts
                  Sorry, the $base_path needs a trailing slash (corrected above).

                  And you shouldn't need to set the $site_url. MODX computes it using the MODX_BASE_URL.

                  $site_url= $url_scheme . $http_host . MODX_BASE_URL;
                      define('MODX_SITE_URL', $site_url);


                  But check that the MODX_BASE_URL setting is correct and also has a trailing slash.
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 44776
                    • 5 Posts
                    Made changed per your instructions now receiving a new error, which seems to me is pointing to the phx plugin?

                    « MODx Parse Error »

                    MODx encountered the following error while attempting to parse the requested resource:
                    « PHP Parse Error »

                    PHP error debug
                    Error: include_once(/home/campasano/public_html/assets/plugins/phx/phx.parser.class.inc.php) [function.include-once]: failed to open stream: No such file or directory
                    Error type/ Nr.: Warning - 2
                    File: /home/campasano/gotrecruited.com/manager/includes/document.parser.class.inc.php(746) : eval()'d code
                    Line: 10

                      • 3749
                      • 24,544 Posts
                      Either that file isn't where it should be, or your assets path is incorrect.

                      What version of MODX are your running?

                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting