We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36551
    • 416 Posts
    I'm seeing a variation of this problem as well. I'm SO close to having this working.

    I've installed modx 2.2.6 in a subfolder with babel 2.2.5. All is working except two items.

    1. The home page for each language is working fine, but any OTHER pages within a context will display the HOME page content for that language even though the url is showing the URL for the OTHER page.

    2. The path to the assets folder in tinymce is not working. I can navigate to the Images, but they are not displayed in the editor but do display on the front-end.

    I'm assuming this is an .htaccess problem. Here my file (excluding some commented lines).

    RewriteEngine On
    RewriteBase /revo-babel/
    
    # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^www\.tbdsandbox\.com [NC]
    RewriteRule (.*) http://www.tbdsandbox.com/$1 [R=301,L]
    
    # The Friendly URLs part
    #RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    
    # redirect all requests to /sp/favicon.ico 
    # to /favicon.ico
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(en|sp)/favicon.ico$ favicon.ico [L,QSA]
    
    # redirect all requests to /sp/assets*
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(en|sp)/assets(.*)$ assets$2 [L,QSA]
    
    # redirect all other requests to /sp/*
    # to index.php and set the cultureKey parameter
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(en|sp)?/?(.*)$ index.php?cultureKey=$1 [L,QSA]
    
    


    Any suggestions would be really appreciated.

    Thank you!
      • 5430
      • 247 Posts
      I'm not sure I'm grasping your description of the first problem. I assume, since you're using Babel, you're using separate contexts for each language? It might be helpful to see what your context settings are for one of the problem contexts. It could be a simple change.

      I've never used RewriteBase to set a subfolder while using Babel, since each context can have it's own base path and base url settings, that might be problematic.

      In regard to #2, have you tried changing TinyMCE's system settings to use absolute paths? If you're using context-specific assets directories this might help.
        • 36551
        • 416 Posts
        Thanks for the fast response!

        My doc tree looks like this:

        web
        - Home (english) 1
        - Another page in english 3
        - contact 4
        Spanish
        - Home (Spanish) 2
        - Another page in Spanish 7

        When I click on either home page I see the content for each of those pages. However, when I go to: http://www.tbdsandbox.com/revo-babel/another-page-in-english.html is get the content from the home page (english).

        Same is true for the Spanish pages, the home page content is displayed when I go to Another page in Spanish.

        Web	
        Base URL     base_url    /
        Culture Key  cultureKey  en
        Site Start   site_start  1
        Site URL     site_url http://www.tbdsandbox.com/revo-babel/
        
        Spanish
        Base URL     base_url    /sp/	
        Culture Key  cultureKey  sp
        Site Start   site_start  2
        Site URL     site_url  http://www.tbdsandbox.com/revo-babel/sp/


        For TinyMCE I'm using one assets/ folder for both contexts. Neither can see the images in the editor.

        Thanks.
          • 36624
          • 535 Posts
          1) you should setup a 404 page to see when there is a problem because when you see the homepage, it's a 404 i think.

          2) Modify your base_url :
          Web	
          Base URL     base_url   /revo-babel/
          Culture Key  cultureKey  en
          Site Start   site_start  1
          Site URL     site_url http://www.tbdsandbox.com/revo-babel/
          
          Spanish
          Base URL     base_url   /revo-babel/sp/
          Culture Key  cultureKey  sp
          Site Start   site_start  2
          Site URL     site_url  http://www.tbdsandbox.com/revo-babel/sp/



          also, if you don't make a translation of your page, babel will make a link to the home page. [ed. note: emmanuel last edited this post 11 years, 4 months ago.]
            CTRL+SHIFT+U - Clear Cache
            CTRL+SHIFT+H - Hiding Heft Panel
            CTRL+SHIFT+N - Fast Create Resource
            CTRL+ALT+P - Preview Recource (in edit resorce window)
            CTRL+ALT+S - Save
            • 36551
            • 416 Posts
            emmanual

            Thanks for helping out. I updated my context as specified and setup a 404 page. I cleared the cache, flushed permissions. No change.

            The english pages are linked to the spanish pages.

            The interior pages all still show the correct url for the page selected but display the home page content for the given context. Neither redirects to 404 page.

            Other ideas?
              • 36624
              • 535 Posts
              ok. i dont remember exactly what's the solution here but i remember having the same problem... :/

              any error.log ?

              Are you sure your page template is different from the home template ? <-- sorry about that but who knows...

              hmm if i do this http://www.tbdsandbox.com/revo-babel/index.php?id=11 i get the 404..

              i found this post : http://forums.modx.com/thread/80284/need-help-with-furl-babel#dis-post-444609
              and he has the same problem..

              maybe you can output [[++cultureKey]] in your tpl to be sure it's correct..

              have you check your context access permissions ?

              mine :

              en
              (anonymous)
              9999
              Load Only

              en
              Administrator
              9999
              Context
                CTRL+SHIFT+U - Clear Cache
                CTRL+SHIFT+H - Hiding Heft Panel
                CTRL+SHIFT+N - Fast Create Resource
                CTRL+ALT+P - Preview Recource (in edit resorce window)
                CTRL+ALT+S - Save
                • 41611
                • 7 Posts
                Hi,
                just spend some hours in .htaccess trying to figure out thy i'm getting 404 error.

                In my case the problem was that i've created the context, but didn't create any documents in it AND didn't set the site_start for context.
                This results in a white page with Error 503 Document not found.

                Hope this will help someone smiley

                  • 49472
                  • 3 Posts
                  Hi,
                  I had the same issue. I was fighting it all the night and figured out that!
                  In my .htaccess file has been changed & to &amp; (entity) in the line
                  RewriteRule ^(cs|en)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]

                  I made some other changes, but I think this was the cause. I have a suspect, that the ampersand was changed by TinyMCE editor. I should't edit .htaccess from the manager... [ed. note: froggiewalker last edited this post 9 years, 5 months ago.]
                  • I've mentioned this many times, but I use an alternate plugin that does not require any .htaccess or other server rewrite rules. https://gist.github.com/gadamiak/3812853

                    See the comments at the bottom for a fix for using the 'web' context, since 'web' is not a cultureKey.
                      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