On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hello,

    I am using YAMS (latest version, 1.1.9) on a MODx site (1.0.2). Last year everything was fine, but in the mean-time, something went wrong and I cannot see what. The site displays the default language (English), all pages in this language are fine, but switching to the other two languages gives a 404 error. Plugin execution order is fine at the OnParseDocument (first YAMS, then PHx)

    The url is www.theeventor.ro. The .htaccess is below.

    Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    
    # Fix Apache internal dummy connections from breaking [(site_url)] cache
    RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
    RewriteRule .* - [F,L]
    
    # Exclude /assets and /manager directories from rewrite rules
    RewriteRule ^(manager|assets) - [L]
    
    # For Friendly URLs
    RewriteCond ${REQUEST_FILENAME} !-f
    RewriteCond ${REQUEST_FILENAME} !-d
    RewriteRule ^en/(.*)$ index.php?q=$1&yams_lang=en [L,QSA]
    RewriteCond ${REQUEST_FILENAME} !-f
    RewriteCond ${REQUEST_FILENAME} !-d
    RewriteRule ^ro/(.*)$ index.php?q=$1&yams_lang=ro [L,QSA]
    RewriteCond ${REQUEST_FILENAME} !-f
    RewriteCond ${REQUEST_FILENAME} !-d
    RewriteRule ^fr/(.*)$ index.php?q=$1&yams_lang=fr [L,QSA]
    RewriteCond ${REQUEST_FILENAME} !-f
    RewriteCond ${REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


    Anyone can help me find the problem? Any other info available on request.
    • Hi,

      maybe you could try this in your htaccess (the way YAMS currently generate htaccess)

      Options +FollowSymlinks
      RewriteEngine On
      RewriteBase /
      
      # Fix Apache internal dummy connections from breaking [(site_url)] cache
      RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
      RewriteRule .* - [F,L]
      
      # Exclude /assets and /manager directories from rewrite rules
      RewriteRule ^(manager|assets) - [L]
      
      RewriteRule ^en$ en/ [R=301,L]
      RewriteRule ^ro$ fr/ [R=301,L]
      RewriteRule ^fr$ fr/ [R=301,L]
      
      # For Friendly URLs
      RewriteCond ${REQUEST_FILENAME} !-f
      RewriteCond ${REQUEST_FILENAME} !-d
      RewriteRule ^en/(.*)$ index.php?q=$1 [L,QSA]
      RewriteCond ${REQUEST_FILENAME} !-f
      RewriteCond ${REQUEST_FILENAME} !-d
      RewriteRule ^ro/(.*)$ index.php?q=$1 [L,QSA]
      RewriteCond ${REQUEST_FILENAME} !-f
      RewriteCond ${REQUEST_FILENAME} !-d
      RewriteRule ^fr/(.*)$ index.php?q=$1 [L,QSA]
      RewriteCond ${REQUEST_FILENAME} !-f
      RewriteCond ${REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


      Hope it helps

      Have swing
        réfléchir avant d'agir