We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49300
    • 19 Posts
    I followed this tutorial about making a multilingual modx: http://designfromwithin.com/blog/modx-multilingual

    I'm getting a 404 error after doing everything from the htaccess, plugin, babel and the site_start value. I only have one language, /cn/. I already created a cn sample page with the right start_value. I have lots of page already and my start page is 297. But when I go to www.website.com/cn/index.html, Page Not Found Error.

    Here's my .htacess. Changed the domain name of my company to website.com for privacy. I cannot show any codes but here's my htacess

    RewriteEngine On
    RewriteBase /
    
    # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
    #RewriteCond %{HTTP_HOST} .
    #RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com [NC]
    #RewriteRule (.*) http://example-domain-please-change.com/$1 [R=301,L]
    #
    # or for the opposite domain.com -> www.domain.com use the following
    # DO NOT USE BOTH
    #
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^www\.website\.com [NC]
    RewriteRule (.*) http://www.website.com/$1 [R=301,L]
    
    
    
    # Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent 
    # https://www.domain.com when your cert only allows https://secure.domain.com
    #RewriteCond %{SERVER_PORT} !^443
    #RewriteRule (.*) https://example-domain-please-change.com/$1 [R=301,L]
    
    
    
    # redirect all requests to /de/favicon.ico and /nl/favicon.ico
    # to /favicon.ico
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(en|cn)/favicon.ico$ favicon.ico [L,QSA]
    						  
    # redirect all requests to /de/assets* and /nl/assets* to /assets*
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(en|cn)/assets(.*)$ assets$2 [L,QSA]
    						 
    # redirect all other requests to /de/* and /nl/*
    # to index.php and set the cultureKey parameter
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(en|cn)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]
    
    


    and here's my gateway plugin

    if($modx->context->get('key') != "mgr"){
    			/* grab the current langauge from the cultureKey request var */
    			switch ($_REQUEST['cultureKey']) {
    				case 'cn':
    					/* switch the context */
    					$modx->switchContext('Chinese');
    					break;
    				default:
    					/* Set the default context here */
    					$modx->switchContext('web');
    					break;
    			}
    			/* unset GET var to avoid
    			 * appending cultureKey=xy to URLs by other components */
    			unset($_GET['cultureKey']);
    		}


    Chinese context looks like this:

    This question has been answered by vanduzled. See the first response.

    • discuss.answer
      • 49300
      • 19 Posts
      Any idea guys?
        • 52123
        • 4 Posts
        Hi, did you get any answer to this? I have the same kind of problem. The web works fine, but not other languages.