允许多个IP通过的.htaccess访问Word preSS网站管理员多个、管理员、网站、IP

2023-09-02 00:53:20 作者:About_美ゝ

我目前正在升级一个字preSS的网站,我在.htaccess文件中一个maintenence重定向设置。

I currently have a wordpress site that is being upgraded and I have a maintenence redirect setup in the .htaccess file.

我可以让我自己的IP访问该网站,管理员,但我怎么能允许多个IP访问为其他编辑器还可以使用。

I can allow my own IP access the site and admin but how can I allow multiple IPs access for the other editors to also have access.

我目前使用:     

I'm currently using :


     
     RewriteEngine on
     RewriteCond %{REMOTE_HOST} !^123.456.789.101
     #RewriteCond %{REMOTE_ADDR} !^123.456.789.101
     RewriteCond %{REQUEST_URI} !/maintanence.html$ [NC]
     RewriteCond %{REQUEST_URI} !.(jpe?g?|png|gif) [NC]
     RewriteRule .* /maintanence.html [R=302,L]
    
    

推荐答案

答案可能有点迟,但:

 RewriteCond %{REMOTE_HOST} !(123.456.789.101|123.456.789.102|123.456.789.103)

效果很好。