We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45739
    • 64 Posts
    All of my templates and article pages were working fine until I enabled Friendly Urls and renamed ht.access to ht.access Then the CSS stopped working on my single blog post pages, you can see an example here: http://wccsrecycling.com/blog/2017/11/18/make-free-beaded-friendship-bracelets-from-recycled-clothes-and-jewelry/

    I tried duplicating and creating a new template. I tried clearing cache. Not sure what else to try. The blog container page works fine: http://wccsrecycling.com/blog

    When I rename .htaccess back to ht.access and disable Friendly URLs it works fine again.

    My htaccess file is the standard MODX file:

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


    Any help would be appreciated. Please and thank you.

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

    • discuss.answer
      • 3749
      • 24,544 Posts
      Some things to do (in this order):

      Make sure you have this tag (with the exclamation point) in the head section of all templates:

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


      Go to Manage -> Clear Cache -> Refresh URIs

      Manually delete all files in the core/cache directory

      Visit the front end with your browser in private or incognito mode.

        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
        • 45739
        • 64 Posts
        Quote from: BobRay at Nov 18, 2017, 03:24 AM
        Some things to do (in this order):

        Make sure you have this tag (with the exclamation point) in the head section of all templates:

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


        Go to Manage -> Clear Cache -> Refresh URIs

        Manually delete all files in the core/cache directory

        Visit the front end with your browser in private or incognito mode.


        I had <base href="[[!++site_url]]" /> at the bottom of my head section. I moved it to the top and it worked. Not sure why that makes a difference, but I wouldn't have even thought to try it had you not commented about it so thank you for your help.
          • 3749
          • 24,544 Posts
          Offhand, I can't think why that would make a difference, but I'm glad you got it sorted. smiley
            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
            • 36732
            • 2 Posts
            From what I had read, the base href acts "FROM NOW ON"
            Ie, it affects the instructions which follow but n ot those who came before...

            One question Bob, I had allways used
            <base href="[[++site_url]]" />
            at the top of m y head section.
            Should I instead call it uncached?
            Thanks, Abner
              • 3749
              • 24,544 Posts
              I'm not sure, but I think if a user visits with the wrong URL right after the cache is cleared, the bad URL can be cached, so it's better to call it uncached. It's also critical for it to be called uncached if there are multiple front-end contexts.
                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