htaccess-如何允许多个IP访问该站点 [英] htaccess - how to allow multiple ips to access the site

查看:287
本文介绍了htaccess-如何允许多个IP访问该站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此代码,仅允许我的ip访问该站点

I'm using this code to allow only my ip to access the site

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{REMOTE_ADDR} !^xxx\.xxx\.xxx\.xxx
 RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC]
 RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
 RewriteRule .* /maintenance.html [R=302,L]
</IfModule>

现在,我想允许我的朋友ip访问该网站。如何在htaccess中指定多个ip?

Now I would like to allow my friends ip to access the site. How to specify multiple ips in htaccess?

推荐答案

使用.htaccess文件限制网站并添加:

Use an .htaccess file to restrict the site and add:

#...
Allow from IP/SubnetMask
Allow from IP/SubnetMask
#...

请参见文档以获取更多详细信息。

See documentation for more details.

这篇关于htaccess-如何允许多个IP访问该站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆