A best practice while disabling entire site for maintenance is to render a HTTP 503 error along with a Retry-After header which will help the to keep indexing your website after downtime is over.
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily