您可以使用.htaccess文件重定向到维护页面:
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteRule ^(.*)$ http://domain.com/maintenance.html [R=307,L]
Run Code Online (Sandbox Code Playgroud)
一些有用的链接:
http://www.shellhacks.com/en/Redirect-Site-to-Maintenance-Page-using-Apache-and-HTAccess
http://perishablepress.com/htaccess-redirect-maintenance-page-site-updates/
http://wp-mix.com/maintenance-mode-htaccess/