Last active
April 7, 2016 09:15
-
-
Save remcotolsma/be6b68ac0e7c360d8ef44362519ce26d to your computer and use it in GitHub Desktop.
WordPress readonly from wp-config.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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