We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17578
    • 33 Posts
    I have a MODX Revolution 2.2.13-pl (traditional) site that has been working fine until last night all of my image, css, and js paths were IP-based (no longer the domain) and HTTPS instead of HTTP. This broke all of the above links. I cleared the site cache and the problem was solved. This has happened before on another MODX site. I'm not sure if this is MODX issue or the host, Media Temple. Has anyone else experienced this? I have <base href="[[++site_url]]" /> in the head. I've checked the forums and haven't found anything. Thanks in advance.
      • 34244
      • 51 Posts
      That is weird. Are you saying that the CSS, JS and image links were changed in the page template(s) to HTTPS IP addresses? Are your links relative or absolute? Are you inserting [[++site_url]] in those links or are they static?

      If the links are static in the template, then I would suspect someone would have had to manually change them somehow or via a security breach.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        It could have something to do with the rewrite rules. Are you running Apache? What does your .htaccess file look like, if you are.

        That clearing the cache fixes the issue looks like it was a temporary thing, and the pages got cached that way. Still, very strange.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 17578
          • 33 Posts
          CSS and JS use absolute; <link rel="stylesheet" href="[[++site_url]]css/normalize.css"> Images placed from TVs are loading relative. I checked the manager reports and only minor edits were done in the afternoon but the sudden change came at night. Weird is right.
            • 17578
            • 33 Posts
            Apache yes. I thought it might be .htacces but the site has been running for 3 months with no issues. I've pasted the relevant .htaccess lines below - it's unedited from the initial MODX install. Thanks for taking a look.

            # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
            #RewriteCond %{HTTP_HOST} .
            #RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com [NC]
            #RewriteRule (.*) http://example-domain-please-change.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\.example-domain-please-change\.com [NC]
            #RewriteRule (.*) http://www.example-domain-please-change.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://example-domain-please-change.com/$1 [R=301,L]



            # The Friendly URLs part
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Well, that's not it. Maybe your hosting company hiccuped or something. They tend to do things without telling people.

              Check your config.inc.php file too. If you can, check its latest modification date and make sure nobody's been messing with it. Also, if you have more than one person in your Manager, check the manager action log.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Oh, and by the way, upgrade at least to 2.2.15 - your version is vulnerable to some rather unpleasant hacking attacks.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 17578
                  • 33 Posts
                  Thanks sottwell, will do. I checked the configs last night and none had changed since April 1. The only user accounts besides me have editor permissions so no access to chunks, snippets, etc. As I said earlier this happened with another MODX install on Media Temple, I'm going to follow up with them but I have a feeling that will lead nowhere.

                  Thanks again for taking a look.

                  R
                    • 3749
                    • 24,544 Posts
                    Do you have any https-related plugins that might be changing the URL?

                    If not, it's probably something the host did.
                      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
                      • 17578
                      • 33 Posts
                      Nope, just the basics; getResouces, IF, MIGX and the very helpful CacheMaster. I'm thinking it has to be the server.