【发布时间】:2013-05-03 22:30:10
【问题描述】:
我知道编写处理维护模式页面的 .htaccess 的基础知识。
我不想使用插件,因为我需要在维护模式下替换整个 WP 站点。
我已尝试添加其他规则以允许访问 WP 后端,仅适用于特定 IP。
我已经尝试了几次,最终都非常接近我的需要。
但是,我也希望列入白名单的 IP 能够看到前端站点,而不会被重定向到维护页面,但我被困在那里。
这是我当前的 .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/images [OR]
RewriteCond %{REQUEST_URI} ^/wp-admin/.* [OR]
RewriteCond %{REQUEST_URI} ^/wp-content/.* [OR]
RewriteRule .+ - [L]
RewriteCond %{REMOTE_ADDR} !^93\.62\.93\.79
RewriteCond %{REQUEST_URI} !^/maintenance-mode\.html$ [NC]
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
RewriteRule .* /maintenance-mode.html [R=302,L]
我应该添加/更改什么?
【问题讨论】:
标签: .htaccess maintenance-mode