We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13914
    • 12 Posts
    Hi.
    I developed a new site for a photographer at http://79.170.44.103/kjporritt.co.uk/, the url supplied by the hosting company I chose, while his site remained live at http://kjporritt.co.uk/.
    Once everything was running OK I changed the nameservers so that the new site went live at http://kjporritt.co.uk/. But suddenly I had a bunch of problems. For example, Wayfinder put some links at http://kjporritt.co.uk/... and some at http://kjporritt.co.uk/kjporritt.co.uk/... in the same navigation menu, and the latter didn't work. Also, some images on the site disappeared. In the manager they looked like they were selected correctly (except there is no image shown in the form), and the url looks OK in the front end, but there's nothing there.
    I managed to force everything to work in the front end by following the advice here http://www.belafontecode.com/how-to-host-multiple-sub-domains-on-modx-revolution/ but applying it to the web context, so that everything is now at http://kjporritt.co.uk/ and Wayfinder works.
    I had to relink the images by hand.
    BUT
    The manager still isn't right. I made the context changes for manager, too, but they didn't help. It's only at http://79.170.44.103/kjporritt.co.uk/manager (although there's a non-working version at http://kjporritt.co.uk/. I can't upgrade from 2.0.8 or turn on friendly urls without introducing a bunch of issues.
    SO
    Does anyone know how I can convince the manager to work at the correct URL?
    BTW I have checked the database and config.inc.php. All the urls are correct there.

      It don't mean nuffink.
      • 3749
      • 24,544 Posts
      Delete all files in the core/cache directory and clear your browser cache and cookies.

      If that doesn't do it, try running Setup in upgrade mode.

        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
        • 13914
        • 12 Posts
        Thanks.
        Tried that.
        Clearing the cache manually didn't help.
        Set up ran OK. But then when I clicked login I was redirected to:
        http://http//kjporritt.co.uk//kjporritt.co.uk/manager/
        That's no good.
        And I can still only actually log in at:
        http://79.170.44.103/kjporritt.co.uk/manager/
          It don't mean nuffink.
          • 3749
          • 24,544 Posts
          Check the path in the modx_workspaces table.

          Also, check the path in the config.core.php files:

          § MODX root directory
          § /manager/
          § /connectors/
          § /setup/includes/

          If there's an .htaccess file in the MODX root directory, rename it for now and leave FURLs turned off in System Settings.
            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
            • 13914
            • 12 Posts
            Thanks Bob.
            All these look right to me.
            The path in the modx_workspaces table is:
            /home/sites/kjporritt.co.uk/public_html/core/

            config.core.php is
            <?php
            define('MODX_CORE_PATH', '/home/sites/kjporritt.co.uk/public_html/core/');
            define('MODX_CONFIG_KEY', 'config');
            ?>


            and in config.inc.php
            if (!defined('MODX_CORE_PATH')) {
                $modx_core_path= '/home/sites/kjporritt.co.uk/public_html/core/';
                define('MODX_CORE_PATH', $modx_core_path);
            }
            if (!defined('MODX_PROCESSORS_PATH')) {
                $modx_processors_path= '/home/sites/kjporritt.co.uk/public_html/core/model/modx/processors/';
                define('MODX_PROCESSORS_PATH', $modx_processors_path);
            }
            if (!defined('MODX_CONNECTORS_PATH')) {
                $modx_connectors_path= '/home/sites/kjporritt.co.uk/public_html/connectors/';
                $modx_connectors_url= '/kjporritt.co.uk/connectors/';
                define('MODX_CONNECTORS_PATH', $modx_connectors_path);
                define('MODX_CONNECTORS_URL', $modx_connectors_url);
            }
            if (!defined('MODX_MANAGER_PATH')) {
                $modx_manager_path= '/home/sites/kjporritt.co.uk/public_html/manager/';
                $modx_manager_url= '/kjporritt.co.uk/manager/';
                define('MODX_MANAGER_PATH', $modx_manager_path);
                define('MODX_MANAGER_URL', $modx_manager_url);
            }
            if (!defined('MODX_BASE_PATH')) {
                $modx_base_path= '/home/sites/kjporritt.co.uk/public_html/';
                $modx_base_url= '/kjporritt.co.uk/';
                define('MODX_BASE_PATH', $modx_base_path);
                define('MODX_BASE_URL', $modx_base_url);
            }
            if(defined('PHP_SAPI') && (PHP_SAPI == "cli" || PHP_SAPI == "embed")) {
            	$isSecureRequest = false;
            } else {
            	$isSecureRequest = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
            }
            if (!defined('MODX_URL_SCHEME')) {
                $url_scheme=  $isSecureRequest ? 'https://' : 'http://';
                define('MODX_URL_SCHEME', $url_scheme);
            }
            if (!defined('MODX_HTTP_HOST')) {
            	if(defined('PHP_SAPI') && (PHP_SAPI == "cli" || PHP_SAPI == "embed")) {
            		$http_host='www.kjporritt.co.uk';
            		define('MODX_HTTP_HOST', $http_host);
            	} else {
            		$http_host= $_SERVER['HTTP_HOST'];
            		if ($_SERVER['SERVER_PORT'] != 80) {
            			$http_host= str_replace(':' . $_SERVER['SERVER_PORT'], '', $http_host); // remove port from HTTP_HOST
            		}
            		$http_host .= ($_SERVER['SERVER_PORT'] == 80 || $isSecureRequest) ? '' : ':' . $_SERVER['SERVER_PORT'];
            		define('MODX_HTTP_HOST', $http_host);
            	}
            }
            if (!defined('MODX_SITE_URL')) {
                $site_url= $url_scheme . $http_host . MODX_BASE_URL;
                define('MODX_SITE_URL', $site_url);
            }
            if (!defined('MODX_ASSETS_PATH')) {
                $modx_assets_path= '/home/sites/kjporritt.co.uk/public_html/assets/';
                $modx_assets_url= '/kjporritt.co.uk/assets/';
                define('MODX_ASSETS_PATH', $modx_assets_path);
                define('MODX_ASSETS_URL', $modx_assets_url);
            


            FURLS are off. Turning them on was one of the things that made me realise I had a problem.
            There's no .htaccess in root.

            Would it be possible to add a .htaccess to force all the incorrect urls:
            http://79.170.44.103/kjporritt.co.uk/ and http://http://kjporritt.co.uk/kjporritt.co.uk/ and http://kjporritt.co.uk/kjporritt.co.uk/
            to http://kjporritt.co.uk/?
              It don't mean nuffink.
              • 3749
              • 24,544 Posts
              I guess so, but it really shouldn't be necessary.

              I wonder if the "hosts" file on your personal computer has an outdated entry in it. Have you tried from another computer?
                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
                • 13914
                • 12 Posts
                The same happens on all computers, so I don't think it is the hosts file.
                Would I be best off re-creating the site in a local test environment, clearing out the existing site, and then replacing it?
                  It don't mean nuffink.
                  • 3749
                  • 24,544 Posts
                  That might make sense, but I had a couple more thoughts. Did you manually set any of the URLs on the Create/Edit Resource page?

                  Do you have a base href tag in the head section of all your templates:

                  <base href="[[!++site_url]]" />


                  The fact that Wayfinder is getting some URLs right and others wrong should be telling us something, but I can't think what it is. Can you confirm that this is the case within the same menu, IOW some menu items have the correct URL and others don't in the same menu?

                  Can you post the Wayfinder Tpl chunk for the menu lines?

                  You could also talk to the host to see if they're doing any redirection, but the fact that WF is getting some of them right argues against that.
                    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
                    • 13914
                    • 12 Posts
                    None of the URLs were set manually.
                    My base href tag is slightly different:
                    <base href="[[++site_url]]" />

                    Is this important?
                    As I mentioned in my original post, I stopped Wayfinder getting some of the URLs wrong by adding base url, http host and site url settings in the web context. It is the manager that won't work properly.
                    The Wayfinder tpl is:
                    <li [[+wf.classes]] >
                    <a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>
                    <span[[+wf.classes]]>/</span>[[+wf.wrapper]]</li>​
                    

                    (Though without the odd characters after the </li> which I can't delete!)
                    The hosting company say they aren't doing any redirection.
                    [ed. note: JeffS last edited this post 12 years, 6 months ago.]
                      It don't mean nuffink.
                      • 3749
                      • 24,544 Posts
                      The exclamation point in the site_url tag makes it uncached. I don't think that's your problem (because it would only affect the front end), but it wouldn't hurt to try adding the ! token.

                      There should be an ht.access file in the Manager directory that just turns off the rewrite engine. Try renaming it to .htaccess and see what that does.

                      Do you have any plugins that could be a factor?

                      Do you have any contexts beyond 'web' and 'mgr'?
                        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