亚洲国产成人久久99精品|四虎久久久久精品无码播放|国产乱偷精品视频a人人澡|欧美日韩精品二区在线|亚洲а∨天堂在线播放2018

網(wǎng)站知識(shí)您當(dāng)前的位置:首頁(yè) >

【新疆】虛擬主機(jī)屏蔽IP地址的方法

發(fā)布時(shí)間:2018-09-17 16:26:03   作者:admin   點(diǎn)擊:
PHP

通過 .htaccess文件屏蔽

IP

代碼如下

RewriteEngine on
RewriteBase /
Order Deny,Allow    ## 拒絕開關(guān),allow表示拒絕訪問
Deny from 182.92.253.20   ##輸入要屏蔽的IP地址
Deny from 121.18.126  ## 屏蔽IP段
ASP

通過在首頁(yè)添加以下代碼實(shí)現(xiàn)

<%
requestIP = request.ServerVariables("REMOTE_ADDR")
IP = "127.0.0.1|192.168.1.1"
trueURL  = "http://www.baidu.com"
falseURL = "http://www.google.com"
ipArr  = split(IP,"|")
flag  = false
for i=0 to ubound(ipArr)
if requestIP=ipArr(i) then
  flag=true
  exit for
end if
next
if flag then
response.Redirect(falseURL)
else
response.Redirect(trueURL)
end if
%>


JS通過以下方式禁止IP訪問

可以通過訪問新浪提供借口獲取IP地址歸屬地相關(guān)信息 :

http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=IP地址



sadno
 
網(wǎng)站關(guān)鍵詞: 虛擬主機(jī) 地址 方法
  • 添加微信好友

  • 微信小程序

  • 在線客服
  • 技術(shù)支持
  • 售后服務(wù)
  • 微信號(hào):15137100750