仅允许使用.htaccess的我的IP进行维护模式

时间:2014-07-14 04:42:14

标签: apache web-services maintenance-mode

我正在尝试将所有用户重定向到维护页面,同时只允许自己使用该网站。我目前有重定向工作,但似乎不允许自己访问该网站。这是我添加到.htaccess文件中的代码:

# Maintenance Redirection
# Replace 555\.555\.555\.555 with your own IP address
# Uncomment first conditional to turn off the redirection
# RewriteCond %{REQUEST_URI} ^$a
RewriteCond %{REQUEST_URI} !maintenance.php
RewriteCond %{REQUEST_FILENAME} !(css|font).+$
RewriteCond %{REMOTE_ADDR} !^555\.555\.555\.555$
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$
RewriteRule (.*) /maintenance.php [R,L]

我用555 \ .555 \ .555 \ .555用我自己的IP地址替换了该区域。我应该注意到我保留了反斜杠,但我假设这是一个转义序列?

提前感谢您的帮助。

0 个答案:

没有答案