We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35756
    • 166 Posts
    I tried for hours to get Babel running on my MODx 2.2.14-install without success. Then I reminded that the site is running with lighttpd on the customers-server, so the htaccess-file is ignored.

    There are two contexts, "web" as the default and "english" as the second one.

    I had to change the rewrite-condition in the lighttpd.conf file to use MODx with friendly-urls from this:

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


    to this:

    url.rewrite-once = ( "^/(assets|manager|core|connectors)(.*)$" => "/$1/$2",
                             "^/(?!index(?:-ajax)?\.php)(.*)\?(.*)$" => "/index.php?q=$1&$2",
                             "^/(?!index(?:-ajax)?\.php)(.*)$" => "/index.php?q=$1"
                       )


    found here: http://rtfm.modx.com/revolution/2.x/getting-started/installation/basic-installation/lighttpd-guide

    But now I don't know how to make the rewrite-routine for Babel working.

    Normally by using the htaccess-file you change the htaccess like the following:

    # redirect all requests to /de/favicon.ico and /en/favicon.ico
    # to /favicon.ico
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(de|en)/favicon.ico$ favicon.ico [L,QSA]
       
    # redirect all requests to /de/assets* and /en/assets* to /assets*
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(de|en)/assets(.*)$ assets$2 [L,QSA]
      
    # redirect all other requests to /de/* and /en/*
    # to index.php and set the cultureKey parameter
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(de|en)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]


    So I tried to change the lighttpd-code to this:

    url.rewrite-once = ( "^/(assets|manager|core|connectors)(.*)$" => "/$1/$2",
                             "^/(?!index(?:-ajax)?\.php)(.*)\?(.*)$" => "/index.php?cultureKey?q=$1&$2",
                             "^/(?!index(?:-ajax)?\.php)(.*)$" => "/index.php?cultureKey?q=$1"


    but then the site did only open the root-/index-site.

    My 2nd try was this:

    url.rewrite-once = ( "^/(assets|manager|core|connectors)(.*)$" => "/$1/$2",
                             "^/(?!index(?:-ajax)?cultureKey?\.php)(.*)\?(.*)$" => "/index.php?cultureKey?q=$1&$2",
                             "^/(?!index(?:-ajax)?cultureKey?\.php)(.*)$" => "/index.php?cultureKey?q=$1"


    By using this code above I could browse through the site in the default-context normally! But when I try to open a site of the other context (like www.website.de/en/ or www.website.de/contact.html) I see the index-page of the default-content, the url in the address-line stays (www.website.de/en/contact.html)

    How do I have to edit the lighttpd.conf to get Babel working?

    EDIT: I was wrong! Even my second try did only show the index-site! I guess it was caching or something that I first could see the sub-sites/-resources of the defult-context. So after editing the lighttpd.conf-file with one of the examples above I only can access the index-site of the default-context! [ed. note: profilneurotiker last edited this post 9 years, 9 months ago.]
      • 35756
      • 166 Posts
      Hello again!

      I am still having this problem, I can't sort this out, even after researching a lot in the internet.

      Doesn't anybody use lighttpd in connection with Babel and has any hint for me to get this working finally?