• Babel - new context not picking up CSS?#

  • gaomeile Reply #1, 9 months ago

    Reply
    Hi,

    I'm creating a bilingual site - english (web) and french (fr). Babel is all set up but for some reason the French context isn't picking up my CSS.
    The web context is all working beautifully so it seems my templates are all fine.

    The french context worked once but then I reinstalled Babel to fix a separate issue and now can't quite get it to work

    Could anyone help identify the problem?

    Thank you

    Modx Revolution 2.1.3
    Babel 2.2.4



  • gaomeile Reply #2, 9 months ago

    Reply
    Found it. I forgot to rewrite all my folders in the root directory in my .htaccess file. Posting below if helpful to anyone.

    # The Friendly URLs part
    # detect language when requesting the root (/)
    RewriteCond %{HTTP:Accept-Language} !^en [NC]
    RewriteRule ^$ fr/ [R=301,L]
    RewriteRule ^$ en/ [R=301,L]
    
    # redirect all requests to /en/favicon.ico and /fr/favicon.ico
    # to /favicon.ico
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(en|fr)/favicon.ico$ favicon.ico [L,QSA]
    
    # redirect all requests to /en/js* and /fr/js* to /js*
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(en|fr)/js(.*)$ js$2 [L,QSA]
    
    # redirect all requests to /en/css* and /fr/css* to /css*
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(en|fr)/css(.*)$ css$2 [L,QSA]
    
    # redirect all requests to /en/assets* and /fr/assets* to /assets*
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(en|fr)/assets(.*)$ assets$2 [L,QSA]
     
    # redirect all other requests to /en/* and /fr/*
    # to index.php and set the cultureKey parameter
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(en|fr)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]