We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 52609
    • 32 Posts
    Quote from: andytough at Aug 16, 2016, 04:06 PM

    It would also be useful to know what your FURL settings are in the Manager and whether you are using an .htaccess file.

    Hi Andy,
    Under Settings, I have left all the settings the same, except I have set "Use Friendly URLs" to Yes.
    I did not turn on "Use Strict Friendly URLs" because I don't know what that actually means.

    I am using .htaccess, in the same directory where MODX is installed. It contains the following:

    RewriteEngine On
    RewriteBase /

    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^thetaooftype\.com [NC]
    RewriteRule (.*) https://thetaooftype.com/$1 [R=301,L]

    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
      • 52609
      • 32 Posts
      Quote from: Steeve at Aug 16, 2016, 04:13 PM
      I did not have this -- I added it to my template and that didn't solve the problem.
      Keep it ! You will need this if you use rewrite URL with alias path ;-)

      Have you try to call the MODX content tag uncached ?
      [[!*content]]

      I'll keep it!

      Well, I just tried putting the ! in the content tag. It didn't solve the problem. Also, I think I would want the content cached as it won't change often when I have the site up.
        • 52609
        • 32 Posts
        Quote from: andytough at Aug 16, 2016, 04:06 PM
        Would you mind posting the code from the template? Is the same template used for both pages? If not could you post both?

        And here is the template.
        I use the same template for all pages. [ed. note: juliehoy last edited this post 7 years, 8 months ago.]
          • 28432
          • 372 Posts
          Quote from: juliehoy at Aug 16, 2016, 04:21 PM
          Well, I just tried putting the ! in the content tag. It didn't solve the problem. Also, I think I would want the content cached as it won't change often when I have the site up.
          It was just here for a test!
            • 38783
            • 571 Posts
            I see you are using https. I wonder if your relative url links to your css are being called up as http?

            In your template where you link to your css try adding [[++site_url]] to the beginning of the path:

            ie:

            <link rel="stylesheet" href="[[++site_url]]assets/css/style.css">
            

              If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

              email: [email protected] | website: https://andytough.com
              • 52609
              • 32 Posts
              Quote from: andytough at Aug 16, 2016, 04:37 PM
              I see you are using https. I wonder if your relative url links to your css are being called up as http?

              In your template where you link to your css try adding [[++site_url]] to the beginning of the path:

              ie:

              <link rel="stylesheet" href="[[++site_url]]assets/css/style.css">
              


              Hmmm, that didn't change anything, but it makes me wonder if a similar reasoning is why Bob uses the following code:
              http://bobsguides.com./where-to-put-stuff.html

              $url = MODX_ASSETS_PATH . 'css/myfile.css';
              $url = MODX_ASSETS_PATH . 'js/myfile.js';

              I didn't use this because I don't know where it goes.
                • 28432
                • 372 Posts
                Quote from: andytough at Aug 16, 2016, 04:37 PM
                I see you are using https. I wonder if your relative url links to your css are being called up as http?

                In your template where you link to your css try adding [[++site_url]] to the beginning of the path:

                ie:

                <link rel="stylesheet" href="[[++site_url]]assets/css/style.css">
                


                If you used
                <base href="[[++site_url]]" />
                normally you don't need to used this
                <link rel="stylesheet" href="[[++site_url]]assets/css/style.css">
                (absolute URL)
                  • 38783
                  • 571 Posts
                  No, I don't completely understand that code of Bobs. Bob's code is always correct though! It is always my understanding of it that is flawed.

                  A few thoughts.

                  1. If you comment out the part in your .htaccess file that forces the https connection does the problem go away?

                  What is it that is wrong about the CSS?

                  2. I noticed that your link to google fonts is being displayed as http not https. So your browser might be blocking that, and any other non https content. Mark Hamstra' s article https://www.markhamstra.com/modx/2012/07/3-tips-for-serving-a-modx-site-over-ssl/ suggests linking using

                  <link href='//fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css'>


                  3. If you view the site in another browser does the problem go away?

                  4. Could you force a refresh of your CSS in your browser by versioning your CSS.
                  ie:

                  <link rel="stylesheet" href="assets/css/style.css?version=1">
                  


                    If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

                    email: [email protected] | website: https://andytough.com
                    • 52609
                    • 32 Posts
                    Quote from: Steeve at Aug 16, 2016, 04:55 PM

                    If you used
                    <base href="[[++site_url]]">
                    normally you don't need to used this
                    <link rel="stylesheet" href="[[++site_url]]assets/css/style.css">
                    (absolute URL)

                    Okay, in my <head> I have:

                    <base href="[[!++site_url]]" />
                    <link rel="stylesheet" href="assets/css/style.css">

                    That should satisfy the url designation needs.
                      • 52609
                      • 32 Posts
                      Quote from: andytough at Aug 16, 2016, 04:58 PM

                      A few thoughts.

                      1. If you comment out the part in your .htaccess file that forces the https connection does the problem go away?


                      I commented out the line in .htaccess that forces https. I refreshed my page and all the CSS was gone.

                      I clicked the link to the offending page, and my template CSS came back without images, but there was no content. I re-un-commented that line in .htaccess and everything stayed as is. I went back to my original .htaccess file without the pretty url stuff, and no change.

                      Using Chrome, I see my template with CSS fine, but the logo image is missing (my images are still there in the directory). I put everything in my template back to how it was originally, just in case messing with the site url business did something. None of the pages show anything but the template with missing image. But the icon image in the same folder shows up on the tab.

                      Using IE (Microsoft Edge), I see the correct template with CSS and with image. Actually, the CSS was originally a bit off, and corrected itself when I clicked a link to the home page! However the front page content within the template frame is missing. If I click the link in the template frame for my Contact page, instead of the contact.html page showing (or nothing showing as currently in Chrome), my main page shows up! The images are not broken in IE.

                      I'm completely stumped as to what happened! I haven't been able to get things back to where they were, either. I cleared the cache in my browser and in MODX. I restarted my computer. I logged in and out of the Manager. The id numbers of the pages haven't changed and the link to the contact page hasn't changed, and the contact page html hasn't changed. If I click View from within the manager, I see the same. Putting in the full path name with https doesn't find the image.

                      Okay, I just got the logo image back in my template by calling it with the full path name using http instead of https! I go back to my .htaccess with the url rules and my logo remains. But still no content. Having or not having <base href="[[++site_url]]" /> doesn't seem to change anything.

                      The same change to the image url in the page content does not bring back their images. Again, a difference in behavior from templates and page resources!

                      I'm out of things to try! Reinstall MODX? If I do that, I do it through softaculous on my cpanel and there's a place for db names -- do I leave that blank? Since I don't want to overwrite my dbs or create new ones?

                      Thanks for any help in sorting out this bizarre behavior.
                      ~Julie