We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3677
    • 130 Posts
    Hi guys,

    SEO savvy folks know that bad things can happen if a search bot crawls your site while it is down. Having an important page replaced in the index with an error page is temporary death to search rankings.

    I noticed in "Tools\Configuration" that ModX has a config item called "Site Status". When the site is set to "Offline", it displays a text message when anyone hits the site.

    Using the text message generates a 503
    [@]When ModX is configured to display a generic text message via the "site unavailable message", it appears that ModX also reports a 503 HTTP status for any site request.
    [@]This is exactly what I want as it is the correct code to indicate a site under maintenance and lets the search engine bot know to check back rather than index the temporary page.

    Setting a custom maintenance page generates a 301
    [@]Displaying a generic text message isn’t very appealing and doesn’t stick with the site theme, so I wanted to have a custom maintenance page.
    [@]I noticed that in the configuration settings there is an option to set the "Site unavailable page" to a specific doc id. This looks like a great solution so I created a page based off my default template to indicate a Maintenance status and set this option to point to it.
    [@]However, now it appears that when the site is offline any requests actually return a 301instead of a 503. A 301 indicates that something has permanently moved, so I really don’t want the search bot to see that when it hits the site during my maintenance.

    I’d really love to be able to use the ModX config manager to handle this without worrying about any negative consequences.
    Is there a way to modify the code such that a 503 is reported when using a custom "site unavailable page"? Or, it would also be fine if search bots are given the 503 and human visitors get the 301.

    I think that this would be another great SEO selling feature for ModX if updated a bit. The alternative is much more of a pain...creating a separate error page outside of ModX and copying over a custom .htaccess using Mod rewrites to get the job done.

    -Brian
      • 3749
      • 24,544 Posts
      Have you tried checking the site from another browser where you’re not logged in in the MODx Manager?

      The checkSiteStatus() function in /manager/includes/document.parser.class.inc.php behaves differently when you’re logged in to the Manager.

      It looks like the function returns false (which triggers the 503 response) only if the site is offline AND you’re not logged into the Manager. In theory, any bot should get the 503 response when the site is offline.
        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
        • 3677
        • 130 Posts
        I checked into this some more...

        I have tested it in a separate browser that is not logged into the manager. I’ve discovered that the SEO Strict URLs plug-in is affecting the results.
        If I disable the strict URLs plug-in, then I get the 503 status as desired and the custom page is displayed.

        When I enable the plug-in, I get a 301 and the custom page is displayed.

        I’m using the following tool to check the response: http://www.seoconsultants.com/tools/headers.asp#results

        -Brian
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: bmilton at Sep 30, 2008, 06:08 PM

          I have tested it in a separate browser that is not logged into the manager. I’ve discovered that the SEO Strict URLs plug-in is affecting the results.
          If I disable the strict URLs plug-in, then I get the 503 status as desired and the custom page is displayed.

          When I enable the plug-in, I get a 301 and the custom page is displayed.
          I’d suggest posting this information in the SEO Strict URL’s support thread to notify the developer or see if anyone else has had this problem.
            • 3677
            • 130 Posts
            Yeah...will do.

            -Brian