Site Unavailable Page During Development

I’m developing a website and during this time I’ve set up a holding / lead capture page. I’ve set the site status to ‘No’. The problem is that although the page is fully visible, it registers as a 503 error so is not being crawled. Is there any way round this? Thank you.

It looks like the 503 status code is hard-coded,

so I don’t think there is a way to change it (when using the site_status functionality).

Thanks Harry. Any ideas how I can achieve a holding page in a different way but still allow the client to log-in and see site progress?

I guess it should be possible to write a custom plugin for that.
(Immediately before the function checkSiteStatus() is called (line 84), the OnHandleRequest event is invoked (line 83).)

In the plugin code, maybe call $modx->checkSiteStatus() and then use sendForward to load the holding page. This could work.

OK thanks Harry - that’s going to be beyond my capabilities and I’m worried that it might lead to other problems. I can set the holding page as the site start and unpublish everything else for now - a bit messy but no other easily achievable option I think.

So here is some code that I think should work:

<?php
if ($modx->context->get("key") != "mgr") {
    if ($modx->event->name == "OnHandleRequest") {
        if (!$modx->checkSiteStatus()) {
            $forwardId = $modx->getOption('site_unavailable_page', null, 1);
            $modx->sendForward($forwardId);
        }
    }
}

It’s for the OnHandleRequest event.

(If you experience any problems with this code or don’t need the functionality any longer, just deactivate the plugin.)

Wow, thank you Harry - that works perfectly - very good of you.