We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Client wants to updated their site from http to https and when I tried to update that in the php files, nothing really updated so I resorted to a manual base href. When I use the [[++site_url]] tag with HTTPS it breaks the CSS.

        [[-<base href="[[!++site_url]]" />]]
        <base href="https://www.domainname.com" />


    Where can I update this globally to make sure the site doesn't break styles/functionality and still use [[+site_url]]?
      Sal Baldovinos
      SEO & DIGITAL MARKETING

      ARIEL DIGITAL | Maximize Your Potential
      www.arieldigitalmarketing.com
    • The site_url is usually automatically generated (and why it has to be called uncached), but could also be configured in context settings.

      What is the value you're seeing when using the tag? Is it showing http or something different?
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
      • Quote from: markh at Apr 24, 2018, 11:06 PM
        The site_url is usually automatically generated (and why it has to be called uncached), but could also be configured in context settings.

        What is the value you're seeing when using the tag? Is it showing http or something different?

        It defaults to http
          Sal Baldovinos
          SEO & DIGITAL MARKETING

          ARIEL DIGITAL | Maximize Your Potential
          www.arieldigitalmarketing.com
        • Did you 301-redirect everything to https in your .htaccess?

          RewriteEngine On
          RewriteBase /
          
          RewriteCond %{HTTPS} off
          RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}  [R=301,L]
          
          RewriteCond %{SERVER_PORT} 80
          RewriteRule ^(.*)$ https://whew100.de/$1


          To make it work quickly, I'd use "no protocol" URLs:
          <base href="//www.domainname.com" />
          • Quote from: gallenkamp at Apr 25, 2018, 06:29 AM
            Did you 301-redirect everything to https in your .htaccess?

            RewriteEngine On
            RewriteBase /
            
            RewriteCond %{HTTPS} off
            RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}  [R=301,L]
            
            RewriteCond %{SERVER_PORT} 80
            RewriteRule ^(.*)$ https://whew100.de/$1


            To make it work quickly, I'd use "no protocol" URLs:
            <base href="//www.domainname.com">

            This is what I currently have
            RewriteEngine On
            RewriteBase /
            
            # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
            #RewriteCond %{HTTP_HOST} .
            #RewriteCond %{HTTP_HOST} !^clientdomain\.com [NC]
            #RewriteRule (.*) http://clientdomain.com/$1 [R=301,L]
            #
            # or for the opposite domain.com -> www.domain.com use the following
            # DO NOT USE BOTH
            #
            RewriteCond %{HTTP_HOST} .
            RewriteCond %{HTTP_HOST} !^www\.clientdomain\.com [NC]
            RewriteRule (.*) https://www.clientdomain.com/$1 [R=301,L]
            
            # Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent
            # https://www.domain.com when your cert only allows https://secure.domain.com
            RewriteCond %{SERVER_PORT} !^443
            RewriteRule (.*) https://www.clientdomain.com/$1 [R=301,L]
            


            Should something else be updated? There's a bit of snag when I try to go to a spanish version of the site too (clientdomain.com/es) ... this worked before I changed it to the direct URL in the base href setting and was using [[+site_url]]
              Sal Baldovinos
              SEO & DIGITAL MARKETING

              ARIEL DIGITAL | Maximize Your Potential
              www.arieldigitalmarketing.com
            • UPDATE: did a little 'hack' (maybe)

              <base href="[[*context_key:is=`Spanish`:then=`//www.domain.com/es/`:else=`//www.domain.com/`]]" />
                Sal Baldovinos
                SEO & DIGITAL MARKETING

                ARIEL DIGITAL | Maximize Your Potential
                www.arieldigitalmarketing.com