We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50613
    • 3 Posts
    I'm running Sitecheck outside of MODX. My MODX installation works fine, but I just prefer to run it externally first.

    Sitecheck is saying:

    MODX_ASSETS_URL: (/assets/) is invalid


    and that part of my config file contains:

    if (!defined('MODX_ASSETS_PATH')) {
        $modx_assets_path= '/home/httpd/mysite/htdocs/assets/';
        $modx_assets_url= '/assets/';
        define('MODX_ASSETS_PATH', $modx_assets_path);
        define('MODX_ASSETS_URL', $modx_assets_url);
    }
    


    Isn't this correct?

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

      • 3749
      • 24,544 Posts
      Have you tried 'assets/' ?

      Generally, the base_url or site_url has a trailing slash and the assets_url is appended to it. Using a preceding slash on the assets_url gives you '//' between them, which works on some platforms but not others.
        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
        • 50613
        • 3 Posts
        Quote from: BobRay at Jun 15, 2015, 08:31 PM
        Have you tried 'assets/' ?

        Generally, the base_url or site_url has a trailing slash and the assets_url is appended to it. Using a preceding slash on the assets_url gives you '//' between them, which works on some platforms but not others.

        Setting it to 'assets/' doesn't work either. Does that directory have to be readable? We have the directories inside 'assets' as readable but 'assets' itself will return '403 Forbidden'.
          • 3749
          • 24,544 Posts
          Forget what I said. Your setting is normal.

          I haven't been able to replicate the error. It's possible that having the assets directory unreadable is causing it. I can't think of any reason to have the assets directory not be readable, since pretty much everything under it needs to be accessible via 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
          • discuss.answer
            • 50613
            • 3 Posts
            Quote from: BobRay at Jun 17, 2015, 12:25 AM
            Forget what I said. Your setting is normal.

            I haven't been able to replicate the error. It's possible that having the assets directory unreadable is causing it. I can't think of any reason to have the assets directory not be readable, since pretty much everything under it needs to be accessible via URL.

            Looking at the Sitecheck code, it seems to give an error if the request for the header of the "assets" URL returns any HTTP Status code other than "200". If I remember correctly, that can only happen if our "assets" directory displays an index of its contents. Rather than change our web server configuration, I tried modifying Sitecheck to accept a "403 Forbidden" code for the "assets" URL and everything worked great from there on.

            Thanks for your help!
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              It doesn't have to display the directory index; that can be turned off in the web server's configuration, and in fact should be on any production server. It does have to be able to access the directory, though, even if the directory index isn't displayed.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Well, well. Checking one of my MODX Cloud installations, trying to access the "assets" directory results in a 403 Forbidden messages. And SiteCheck does indeed fail on that test. Very odd - I've been using SiteCheck for some time on all of my MODX Cloud sites with no problems.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 3749
                  • 24,544 Posts
                  Quote from: jonathanpowers at Jun 17, 2015, 11:53 AM
                  Rather than change our web server configuration, I tried modifying Sitecheck to accept a "403 Forbidden" code for the "assets" URL and everything worked great from there on.

                  I was just in the process of doing that. wink

                    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
                    • 35756
                    • 166 Posts
                    Hi there!

                    I just purchased SiteCheck as well and I'm running into the same problem:


                    MODX_ASSETS_URL: (/assets/) is invalid


                    How do I do the changes Jonathanpowers mentioned:

                    I tried modifying Sitecheck to accept a "403 Forbidden" code for the "assets" URL and everything worked great from there on.

                    Additionally, when I run SiteChick inside the MODx-backend, by clicking on "Perform Tests" the page reloads, but it gets displayed on a blank site, the whole backend disappears; is it the way it's supposed to work?

                    Cheers in advance...
                      • 3749
                      • 24,544 Posts
                      A status of 403 is already accepted in the newest version. Do you have version 1.0.7-pl?

                      If you do have the latest version, you might try this and see if it tells us anything about what status code you're getting. Around line 277 of the core\components\sitecheck\model\sitecheck\pathcheck.class.php file,

                      Just below this comment:
                      /* Treat 401 and 403 as valid since the URL exists */

                      Replace this code:

                      $this->helpers->output(8, $key . ": (" .
                         $url . ') ' .
                         $this->modx->lexicon('sitecheck_is_invalid'),
                         false, true, 'sc_red sc_block sc_indent2');
                      $this->totalConfigErrors++;
                      $this->totalErrors++;
                      $urlsOk = false;


                      with this:

                      $this->helpers->output(8, $key . ": (" .
                         $url . ') ' .
                         $this->modx->lexicon('sitecheck_is_invalid') . 
                         ' Status: ' . $status
                         , false, true, 'sc_red sc_block sc_indent2');
                      $this->totalConfigErrors++;
                      $this->totalErrors++;
                      $urlsOk = false;


                      The blank screen happens when there's a serious error during the "pathcheck" part of the process, where MODX doesn't exist yet. I haven't been able to find a good way to prevent it. If you skip the "check config files" step (and maybe "check permissions"), you should avoid that.
                        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