.htaccess Maintenance Multiple IP's

前端 未结 1 2079
滥情空心
滥情空心 2021-02-14 23:15

I am using the code below within my .htaccess file to place my site into maintenance. Essentially what it does is to redirect anyone who is NOT from a specific IP address to a

相关标签:
1条回答
  • 2021-02-15 00:09

    Just adding another RewriteCond to handle the second IP address should be fine, like so:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REMOTE_ADDR} !=23.254.12.43
    RewriteCond %{REMOTE_ADDR} !=192.168.0.1
    RewriteCond %{REQUEST_URI} !^/maintenance\.html$
    RewriteRule ^(.*)$ http://maintenance.mysite.com [R=307,L]
    
    0 讨论(0)
提交回复
热议问题