-1
A
回答
1
您可以使用apache的geoip mod(http://www.maxmind.com/app/mod_geoip)。 Mod_rewrite規則可以決定如何處理頁面。
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CA$
RewriteRule ^(.*)$ http://www.america.com$1 [F]
殲禁止頁面訪問
0
不,除非你有你的控制下,該域的DNS服務器。你通常不會爲domain.tld這樣的域名,你只能根據客戶端ip調整內容 - 例如你可以按照你的建議提供一個空白頁面。但是仍然可以使用nslookup等工具查詢域。
0
如果您無權訪問DNS服務器,則可以添加.htaccess規則以禁止來自特定ipaddresses的用戶。以下是一些樣品的.htaccess規則
order allow,deny
deny from 123.456.789.012 #block the visitors from the specific ipaddress 123.456.789.012
deny from 123.456.789. #blocks the visitors from all ip within the range 123.456.789.xxx (i.e. 123.456.789.000 – 123.456.789.255)
deny from 123.456. #blocks the visitors from all ip within the range 123.456.xxx.xxx
deny from 123. #blocks the visitors from all ip within the range 123.xxx.xxx.xxx
allow from all #allow from all other.
0
<?php
if (getenv(HTTP_X_FORWARDED_FOR)) {
$pipaddress = getenv(HTTP_X_FORWARDED_FOR);
$ipaddress = getenv(REMOTE_ADDR);
echo "Your Proxy IPaddress is : ".$pipaddress. "(via $ipaddress)" ;
} else {
$ipaddress = getenv(REMOTE_ADDR);
echo "Your IP address is : $ipaddress";
}
?>
此代碼ü可以用它來得到訪問者的IP地址......
要檢測你需要一些免費的API區域.. Try this..
第二個是很容易使用..
<A HREF="http://www.hostip.info">
<IMG SRC="http://api.hostip.info/flag.php?ip=12.215.42.19" ALT="IP Address Lookup">
</A>
相關問題
- 1. 阻止從特定IP訪問網站?
- 2. 從網站拉IP地址
- 3. 來自公共ip的訪問網站
- 4. 通過IP地址訪問時,網站上未顯示圖像
- 5. 禁止通過禁止的IP地址訪問網站
- 6. 隨機IP地址訪問我的網站
- 7. PHP禁止IP地址阻止用戶訪問網站
- 8. 我無法使用其IP地址訪問我的網站
- 9. 網站是通過IP地址訪問,但不是域名?
- 10. 如何通過ip地址訪問共享主機網站
- 11. 通過公共ip訪問本地託管的網站
- 12. 在Java中查找您的網站訪問者IP地址
- 13. 通過IP地址瀏覽器訪問新網站?
- 14. 使用我的內部IP地址訪問網站
- 15. 我可以使用IP地址訪問網站
- 16. htacess - 如何讓多個IP地址來訪問網站
- 17. IP地址無法訪問或無效
- 18. PHP從網站訪問者
- 19. 從代碼訪問網站
- 20. 當訪問者從網站
- 21. 從Azure網站訪問Couchbase
- 22. 如何將我的IP地址更改爲給定地址並訪問網站
- 23. 通過IP地址從bash訪問AWS
- 24. AWS訪問策略允許從IP地址或IAM用戶訪問
- 25. 從局域網訪問ASP.NET網站
- 26. 如何獲取訪問網站網址的用戶ip?
- 27. 訪問facebook登錄本地網站
- 28. 如何訪問網站的2地址
- 29. 訪問Jekyll網站跨本地wifi
- 30. 通過私人地址訪問網站
爲什麼? ww =全球範圍內,區域阻塞是平均值。 – 2012-01-05 05:18:25
更不用說如果整個國家的用戶被視爲一個IP,即ISP的IP,您將阻止整個國家! – Joseph 2012-01-05 08:03:09