Skip to content

Instantly share code, notes, and snippets.

@remcotolsma
Last active April 7, 2016 09:15
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
WordPress readonly from wp-config.php
<?php
// ...
if ( is_readable( 'readonly.html' ) && ! in_array( $_SERVER['REQUEST_METHOD'], array( 'HEAD', 'GET' ) ) ) {
header( 'HTTP/1.1 503 Service Temporarily Unavailable', true, 503 );
header( 'Status: 503 Service Temporarily Unavailable', true, 503 );
header( 'Retry-After: 3600' );
include 'readonly.html';
exit;
}
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment