如何重定向整个网站和除我的IP地址以外的所有流量


How to redirect an entire site and all traffic but my ip address?

我一直在寻找如何将所有流量重定向到某个页面,但我的 IP 地址,但我找不到我正在寻找的......我想做的是将整个站点重定向到一个页面,而不仅仅是一个页面,而不是重定向我的IP地址。我试过这个:

RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} !^123'.456'.789'.
RewriteCond %{REQUEST_URI} !/page'.html$  
RewriteRule .* http://www.example.com/maintenance.html [R=302,L]

但它只重定向一个页面..而且我的页面太多了,无法继续添加另一个RewriteCond

应该有效。

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !=123.456.789
RewriteRule .* http://www.example.com/maintenance.html [R=302,L]