我知道编写处理维护模式页面的.htaccess的基础知识。
我不想使用插件,因为我需要更换整个可湿性粉剂网站在维护模式。
我已经尝试添加额外的规则,以允许访问WP后端,只针对特定的I。
我尝试了几次,最终非常接近我所需要的。
然而,我也希望白名单上的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]我应该添加/更改什么?
发布于 2013-07-03 23:02:03
你找到解决方案了吗?我没有测试它与可湿性粉剂,但这对我的另一个CMS工作。
Options +FollowSymLinks
RewriteEngine On
# exclude file (otherwise infinity loop)
RewriteCond %{REQUEST_URI} !^/under-construction/maintenance\.php$
# exclude images and css
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif|css) [NC]
# If it's not your IP address
RewriteCond %{REMOTE_HOST} !^111\.222\.333\.444$
# Redirect /abc to example.com/abc.
RewriteRule ^(.*)$ http://www.domain.com/under-construction/maintenance.php [R=307,L]也许它会对你有所帮助。
https://stackoverflow.com/questions/16461922
复制相似问题