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

    This is driving me crazy, on our clients site the home button is linking to localhost but only on the homepage.

    Using code inspector shows this.

    <a href="https://localhost/">Home</a>


    On every other page it links as though correctly.

    The header code looks like this:

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>[[*pagetitle]] - [[++site_name]]</title>
    <base href="[[!++site_url]]" />
    <meta name="description" content="[[*description]]">
    <link href="assets/reset.css" rel="stylesheet" type="text/css" />
    <link href="assets/style.css" rel="stylesheet" type="text/css" />


    The site did originally show the link as https://xx.xx.xx.xx however something has changed after I suspected it was the server and the client rang rackspace. Its now showing as localhost.

    Rackspace however, are positive its an issue with either the CMS.

    Any help would be appreciated.

    This question has been answered by matdave. See the first response.

      • 30585
      • 833 Posts
      How did you create your home link in the template? Was it something like this: <a href="[[~1]]">Home</a>?
        A MODx Fanatic
        • 3749
        • 24,544 Posts
        Is there anything in .htaccess that could be doing that?

        MODX uses whatever URL you come in on for the site_url setting.

        You might also take a look at the core/config/config.inc.php file to see if it says 'localhost' anywhere.
          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
          • 46477
          • 21 Posts
          Quote from: treigh at Dec 08, 2014, 06:44 PM
          How did you create your home link in the template? Was it something like this: <a href="[[~1]]">Home</a>?

          Sorry, I'm using wayfinder to generate the menu. [ed. note: howvard last edited this post 11 years, 10 months ago.]
            • 46477
            • 21 Posts
            Quote from: BobRay at Dec 09, 2014, 12:31 AM
            Is there anything in .htaccess that could be doing that?

            Not that I can see, but there are a lot of redirects, If its ok I can PM you the htaccess file.

            Quote from: BobRay at Dec 09, 2014, 12:31 AM
            MODX uses whatever URL you come in on for the site_url setting.

            You might also take a look at the core/config/config.inc.php file to see if it says 'localhost' anywhere.

            The only localhost in the config file is for the database connection.

            if (!defined('MODX_SITE_URL')) {
                $site_url= $url_scheme . $http_host . MODX_BASE_URL;
                define('MODX_SITE_URL', $site_url);
            }
              • 46477
              • 21 Posts
              One thing I did forget to mention, the home URL is correct on every page in MODX apart from the homepage and if you clear the cache and log out the URL is then correct.

              It seems to take a few hours and then the URL defaults back to https://localhost
                • 3749
                • 24,544 Posts
                If you don't see the word 'localhost' in the .htaccess file, the problem isn't there.

                You didn't answer Treigh's quesion:

                How did you create your home link in the template? Was it something like this: <a href="[[~1]]">Home</a>?

                You might also look in cPanel and see if there is a virtual host that someone set up.
                  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
                  • 46477
                  • 21 Posts
                  Quote from: BobRay at Dec 09, 2014, 01:11 PM
                  If you don't see the word 'localhost' in the .htaccess file, the problem isn't there.

                  You didn't answer Treigh's quesion:

                  How did you create your home link in the template? Was it something like this: <a href="[[~1]]">Home</a>?

                  You might also look in cPanel and see if there is a virtual host that someone set up.

                  I'm using wayfinder to generate the menu.

                  There is no cPanel on the server, its a managed dedicated server with a clean install of RedHat.

                  From memory there was just the one vhost file domain.co.uk

                  It seems strange that the URL works fine when the cache is cleared and then it defaults back to localhost.
                    • 3749
                    • 24,544 Posts
                    What version of MODX is this?
                      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
                      • 46477
                      • 21 Posts
                      Quote from: BobRay at Dec 09, 2014, 01:40 PM
                      What version of MODX is this?
                      2.3.1-pl

                      Strangely, when i'm logged in and come back to the site the URL is correct?