We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40643
    • 36 Posts
    I am using version 2.2.8 and I am having trouble getting the link below to render properly. It doesnt display the http:// in the href but it does in the text.

    Website: <a href="[[++site_url]]">[[++site_url]]</a>

    If I use the code below it renders without the colon.

    Website: <a href="http://[[++site_url]]">[[++site_url]]</a>

    How can I fix this?

    Thanks

    Lisa
      • 38705
      • 101 Posts
      Hi Lisa,

      does this work for you?

      <a href="[[~[[++site_start]]]]">[[++site_name]]</a>
      

      or
      <a href="[[~[[++site_start]]]]">[[++site_url]]</a>


        Addict since 2012....
        • 3749
        • 24,544 Posts
        Do you have a site_url System Setting or Context Setting (you shouldn't, unless you're using multiple front-end contexts).

        If you do have multiple contexts, check the site_url Context setting for each context.

        If that's not it, check the core/config/config.inc.php file and look at the $site_url and $url_scheme settings. They should look like this:


        $url_scheme=  $isSecureRequest ? 'https://' : 'http://';
            define('MODX_URL_SCHEME', $url_scheme);
        

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


        Also, make sure you have this tag in the head section of all templates:

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


        If you have multiple contexts, it should be (added exclamation point):

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

        [ed. note: BobRay last edited this post 13 years, 4 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
          • 40643
          • 36 Posts
          Quote from: mintnl at Jun 15, 2013, 04:33 PM
          Hi Lisa,

          does this work for you?

          <a href="[[~[[++site_start]]]]">[[++site_name]]</a>
          

          or
          <a href="[[~[[++site_start]]]]">[[++site_url]]</a>



          Thanks for your assistance. It is working with my original code. It doesnt look correct when hovering over the link.
            • 40643
            • 36 Posts
            Thanks Bob, Everything is looking ok in the config file.

            Thanks again.

            Lisa