We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22840
    • 1,572 Posts
    I would do it via the .htaccess which most multi lang systems do, something like the below should work but change the en|nl|de to whatever your culture keys are

    # redirect all requests to /de/assets* and /nl/assets* to /assets*
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(en|nl|de)/assets(.*)$ assets$2 [L,QSA]
      • 3749
      • 24,544 Posts
      I don't do multi-context sites any more, so I'm not much help here. Are you sure you don't mean [[++assets_url]]? That's what you need for images, CSS, and JS files. It's easy to get them confused.

      Check the MODX_ASSETS_PATH and MODX_ASSETS_URL settings in core/config/config.inc.php - that's usually what's used for any access to the assets area. If that doesn't work, I'd go with PaulP's suggestion.

        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
        • 42042
        • 140 Posts
        @BobRay, thanks so much for you time. I'll try PaulP's method. How do you handle multiple languages then?
        @paulP, thanks for your help. I've tried it but no luck yet, maybe the .htaccess needs to sync. But this piece of code can rewrite my html path?
          • 3749
          • 24,544 Posts
          TBH, I've never done a multi-language site.

          Make sure PaulP's code is above any other rewrite rules, but after the RewriteEngine on and RewriteBase line, which should be:

          RewriteBase / 
            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
            • 42042
            • 140 Posts
            Quote from: BobRay at Jul 04, 2016, 12:48 AM
            TBH, I've never done a multi-language site.

            Make sure PaulP's code is above any other rewrite rules, but after the RewriteEngine on and RewriteBase line, which should be:

            RewriteBase / 

            This fixes it! I've put the rules above the default rewrite rules of modX and it works. So final code:

            # redirect all requests to /de/assets* and /nl/assets* to /assets*
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(eng)/assets(.*)$ assets$2 [L,QSA]
            
            # The Friendly URLs part
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
            


            Thanks to you all. You guys keep this community alive.
              • 3749
              • 24,544 Posts
              I'm glad we could help. Paulp deserves most of the credit.
                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