We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43106
    • 6 Posts
    Hey folks, if i hit the preview button of any of my sites...it directs me to a 404 Page saying "503 - Page not found"...
    It's a neraly clean revo install and i have no idea why he's doing it :/ only thing i did was to install a plugin:

    1
    
    //make sure our plugin does not run on the mgr context (the manager)
        if($modx->context->get('key') != "mgr"){
            //grab the current domain from the http_host option
            switch ($modx->getOption('http_host')) {
                case 'en.example.com':
                    //switch the context
                    $modx->switchContext('en');
                    //set the cultureKey
                    $modx->setOption('cultureKey', 'en');
                    break;
                default:
                    // Set the default language/context here
                    $modx->switchContext('chinese');
                    $modx->setOption('cultureKey', 'zh');
                    break;
            }
        }


    anybody got a idea?
      • 44537
      • 13 Posts
      It may be the same problem I've got: http://forums.modx.com/thread/86070/enabling-friendly-url-does-not-display-any-page-except-the-top-page#dis-post-474601
      Although the problem came back, renaming ht.access (under /web) .htaccess temporarily solved it for a few hours, so you might want to check the name of the file just in case.
        • 3749
        • 24,544 Posts
        Check the actual value of the 'http_host' with a snippet on the home page. And, if possible, you might want to use an actual case for the second context rather than 'default'.

        Do you have this tag in the head section of all templates (note the exclamation point -- you don't want a cached version of the site_url)?

        <base href="[[!++site_url]]" />
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting