We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51824
    • 27 Posts
    Hello,

    Problem: when trying to load /setup in the new location, I'm redirected to the old location.

    Detailed description:

    (Version: modx revo 2.4.2pl)

    I have a webspaceaccount containing four different Domains, each represented by an own subfolder beneath root/www


    I developed my modxbased site in one of these subfolders, for example available via "www.domain1.de".
    Later I want to change this to the final location, available via "www.domain3.de".

    But 'cause I don't want to mess things up, I first made a test moving it to subfolder available via "www.domain2.de".


    I followed instructions described here:
    https://rtfm.modx.com/revolution/2.x/administering-your-site/moving-your-site-to-a-new-server

    So I downloaded all from domain1.de (via FileZilla - FTP), uploaded it to the new folder for domain2.de.

    I changed all paths in
    domain2.de/core/config/config.inc.php,
    domain2.de/config.inc.php,
    domain2.de/connectors/config.core.php,
    domain2.de/manager/config.core.php


    Since I moved and renamed folders core, manager, components and connectors in the first installation (following this description: https://docs.modx.com/revolution/2.x/administering-your-site/security/hardening-modx-revolution)
    I renamed all folders in domain2.de/core/config/config.inc.php according to the original made changes.

    Then I dumped Mysql-Database and uploaded it to a new db on the same server (since I didn't want to mess up anything. Changed username and databasename in domain2.de/core/config/config.inc.php thereafter.

    I changed all occurrencies of "domain1.de" in .htacces to "domain2.de".

    I looked for the "path" in the ".workspaces"-table - there I only found the value "{core_path}", so I think I don't have to update anything here since it seems to be a description for earlier modx-revo-versions.

    Finally I uploaded the "setup" folder of an modx Version 2.4.2 pl to domain2.de for updating my database as described in the manual mentioned first.

    When trying to load the setup (by typing "www.domain2.de/setup" as URL I'm beeing forwarded to "www.domain1.de/setup" and since this folder doesn't exist to "www.domain1.de".

    Where's my mistake?

    P.S: Calling the site with "www.domain2.de" shows the page as awaited - but every link links to "www.domain1.de/<linkname>"

    This question has been answered by multiple community members. See the first response.

    [ed. note: calvair last edited this post 9 years, 11 months ago.]
      • 3749
      • 24,544 Posts
      First, try manually deleting all the files in the core/cache directory. The old site_url may be cached there.

      If that doesn't help, the most likely culprit is your .htaccess file.
        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
        • 51824
        • 27 Posts
        Hi Bob,
        thank you for your reply!

        I just tried exactly that (cleared all directories and files inside core/cache) - and this resulted in a "500 - Site temporarily unavailable"-Error.

        Will try the whole move again this evening ... (perhaps then only deleting all files in /core/cache and not the directories (?) ...
          • 42562
          • 1,145 Posts
          Check you new DB tables for system_settings, what are the context settings? base_url, site_url etc
            TinymceWrapper: Complete back/frontend content solution.
            Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
            5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
            • 51824
            • 27 Posts
            hm - in which table will I find these settings?

            I also thought about base-url, since I defined one in each template, but I simply can't find where the templates are stored (to dumb... smiley )

            • discuss.answer
              • 42562
              • 1,145 Posts
              Find appropriate context and edit
              modx_context_setting


              Or go to main settings (show all rows) ... find site_url and other stuffs
              modx_system_settings
                TinymceWrapper: Complete back/frontend content solution.
                Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                • 51824
                • 27 Posts
                Quote from: donshakespeare at Oct 10, 2016, 01:26 PM
                Find appropriate context and edit
                modx_context_setting

                ok... first of all: sorry! I didn't see phpMyAdmin wasn't showing all tables at once smiley of course there is a table called xx_context_settings.
                Found base_ and site_url for all contexts (web, english and svenska since I have installed Babel for multilingual support) and edited them to represent the new URL.

                -> nothing changed in the behaviour of my site, still links are pointing to the old URL and domain2.de/setup redirects me to domain1.de/setup

                Quote from: donshakespeare at Oct 10, 2016, 01:26 PM

                Or go to main settings (show all rows) ... find site_url and other stuffs
                modx_system_settings

                -> there is no site_url key and no value containing the old URL.

                So I'm still having my problem, despite of both of your helfpul advices, BobRay and donshakespeare, for which I'm thankful...

                BobRay: .htaccess doesn't have any hints or values to the old URL.


                In my templates I have the row saying:

                <base href="http://www.domain1.de/" />, perhaps THIS is causing the problem and misleading all links. In the templates it's written as
                <base href="[[!++site_url]]" />

                but where the heck ist this "site_url" defined? Isn't it that key in modx_content_settings, which I changed above?
                Perhaps the web-server has to be restarted for the changes to take place? (but since it's not my server, I have no possibility to restart it)

                [ed. note: calvair last edited this post 9 years, 11 months ago.]
                • discuss.answer
                  • 3749
                  • 24,544 Posts
                  The site_url System Setting is created on-the-fly, based on the URL the user comes in on, so you won't find it anywhere.

                  Have you looked at the values in the core/config/config.inc.php file?
                    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
                    • 51824
                    • 27 Posts
                    Have you looked at the values in the core/config/config.inc.php file?

                    Sure wink None of the values represented in this file gives any hint to the old URL. My core/config/config.inc.php looks like this (values substituted by example-values, some values excluded for security reasons (like all the database-stuff))

                    <?php
                    /**
                     *  MODX Configuration file
                     */
                    
                    /*
                    [...database stuff...]
                    */
                    
                    $config_options = array (
                    );
                    $driver_options = array (
                    );
                    
                    $lastInstallTime = 1454514219;
                    
                    /* site-id, session and so on excluded in this quote /*
                    
                    if (!defined('MODX_CORE_PATH')) {
                        $modx_core_path= '/home/www/TP_core/';
                        define('MODX_CORE_PATH', $modx_core_path);
                    }
                    if (!defined('MODX_PROCESSORS_PATH')) {
                        $modx_processors_path= '/home/www/TP_core/model/modx/processors/';
                        define('MODX_PROCESSORS_PATH', $modx_processors_path);
                    }
                    if (!defined('MODX_CONNECTORS_PATH')) {
                        $modx_connectors_path= '/home/www/xx_bestellung.de/TP_connect/';
                        $modx_connectors_url= '/TP_connect/';
                        define('MODX_CONNECTORS_PATH', $modx_connectors_path);
                        define('MODX_CONNECTORS_URL', $modx_connectors_url);
                    }
                    if (!defined('MODX_MANAGER_PATH')) {
                        $modx_manager_path= '/home/www/xx_bestellung.de/TP_manager/';
                        $modx_manager_url= '/TP_manager/';
                        define('MODX_MANAGER_PATH', $modx_manager_path);
                        define('MODX_MANAGER_URL', $modx_manager_url);
                    }
                    if (!defined('MODX_BASE_PATH')) {
                        $modx_base_path= '/home/www/xx_bestellung.de/';
                        $modx_base_url= '/';
                        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.xx_bestellung.de';
                            define('MODX_HTTP_HOST', $http_host);
                        } else {
                            $http_host= array_key_exists('HTTP_HOST', $_SERVER) ? $_SERVER['HTTP_HOST'] : 'www.xx_bestellung.de';
                            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/www/xx_bestellung.de/TP_assets/';
                        $modx_assets_url= '/TP_assets/';
                        define('MODX_ASSETS_PATH', $modx_assets_path);
                        define('MODX_ASSETS_URL', $modx_assets_url);
                    }
                    if (!defined('MODX_LOG_LEVEL_FATAL')) {
                        define('MODX_LOG_LEVEL_FATAL', 0);
                        define('MODX_LOG_LEVEL_ERROR', 1);
                        define('MODX_LOG_LEVEL_WARN', 2);
                        define('MODX_LOG_LEVEL_INFO', 3);
                        define('MODX_LOG_LEVEL_DEBUG', 4);
                    }
                    if (!defined('MODX_CACHE_DISABLED')) {
                        $modx_cache_disabled= false;
                        define('MODX_CACHE_DISABLED', $modx_cache_disabled);
                    }
                    



                    The site_url System Setting is created on-the-fly, based on the URL the user comes in on, so you won't find it anywhere.
                    That's what I thought first also - but even when I can't find any representation of "bestellung-xx.de" in the config files as well as in the table xx_context-settings as well as in .htaccess, everytime I call the site in my browser via "x_bestellung.de", the value of "base href", which is written in the source code of my template like this:

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

                    , the [[!++site_url]]-placeholder will be substituted by "bestellung-xx.de" - the old location of my website.

                    Somehow I seem to be stuck... while I followed the manual step by step (at least I think I did - otherwise I won't ask for advices here smiley )
                      • 42562
                      • 1,145 Posts
                      In your Browser (Manager Page) console (Chrome etc) ... enter and return MODx.config['site_url'] . What is the value for said new troublesome domain?
                        TinymceWrapper: Complete back/frontend content solution.
                        Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                        5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.