Environment: VPS, Centos, Ngix, Wordpress
1. To block all Chinese IP and Chinese language visitors
2. Blocking proxy access
3. The above access jumps to a specific page or displays a specific text
4. Allow search engine spiders such as Googlebot access
5. Allow yourself to access
Ask for more, forgive me not to write PHP code ...
Reply content:
To block all Chinese IP and Chinese-language visitors
It's not easy! At the beginning of your PHP file index.php, add a sentence
header("X-Blocked-Keyword: dongtaiwang.com")
Provides a way to block a specific country IP, DNS is not resolved.
The Incapsula free version provides shielding national functionality. Purely theoretical analysis, I do not know whether to help:
Php:geoip-manual , PHP appears to have a geo module, you can access the IP address of the geographical analysis, if from the CN, processing off itself. (Usage introduction GEOIP use-PHP version )
Language, you can try to check the HTTP header's desired language and dispose of the zh-* yourself.
Agent Kung Fu Big This needless to say, but you can refer to the Wikipedia block table (
Phone answer. JS code to determine whether the browser's language header contains "zh, CN" Content, do a jump is not good place to change an English browser can access.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.