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
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.