htAccess files (hypertext Access file) is a very powerful configuration file for Apache Web servers, and for this file, Apache has a bunch of parameters that allow you to configure almost any function you want.
Use. htaccess block search engine spider
Block out Baidu search engine
Baidu is the legendary violence search engine, does not follow the rules of the search engine, if you try to use Robot.txt to block, it is very congratulations, absolutely invalid. So be sure to use a more violent, tough way to do it, so through. Htaccess can be handled, if you want to block out some search engine (such as Baidu, Sogou, etc.), then please paste the following code into the Htaccess.txt file.
Setenvifnocase user-agent "^baidu" Bad_bot Setenvifnocase user-agent "^sogou" Bad_bot Setenvifnocase user-agent "^bloghoo" Bad_bot Setenvifnocase user-agent "^scooter" Bad_bot Deny from Env=bad_bot |
Block out Google search engine
If you want to block the Google search engine, of course, can also be blocked by the. Htaccsee, just enter the following code on it, if you want to block with the violent Baidu search engine, then put these two programs in the same Htaccsee.txt file.
Setenvif user-agent "^googlebot" Google Deny from Env=google |
Use. htaccess to block a country's IP network segment
Sometimes they may draw the direction of the development of the site, there are not welcome to certain countries to visit, this time the first idea should be to lock the country's IP, but do not know where to start? Because do not know that the country's IP and Ben cannot lock, this time can through the "blockcountry" online tool website generated by the htaccess grammar to block the IP network segment of the country you want to block.
1th Step to block Country (http://www.blockcountry.com) homepage, first you will see a box, there are many countries in the box, please select the country you want to block, you can check, choose to complete, click below the ﹝block now! ﹞。
The 2nd step is to paste the code generated on the Web page into the htaccess file and store it. Apache will return a 403 error for rejected IPs.
htAccess files (hypertext Access file) is a very powerful configuration file for Apache Web servers, and for this file, Apache has a bunch of parameters that allow you to configure almost any function you want.
Use. htaccess block search engine spider
Block out Baidu search engine
Baidu is the legendary violence search engine, does not follow the rules of the search engine, if you try to use Robot.txt to block, it is very congratulations, absolutely invalid. So be sure to use a more violent, tough way to do it, so through. Htaccess can be handled, if you want to block out some search engine (such as Baidu, Sogou, etc.), then please paste the following code into the Htaccess.txt file.
Setenvifnocase user-agent "^baidu" Bad_bot Setenvifnocase user-agent "^sogou" Bad_bot Setenvifnocase user-agent "^bloghoo" Bad_bot Setenvifnocase user-agent "^scooter" Bad_bot Deny from Env=bad_bot |
Block out Google search engine
If you want to block the Google search engine, of course, can also be blocked by the. Htaccsee, just enter the following code on it, if you want to block with the violent Baidu search engine, then put these two programs in the same Htaccsee.txt file.
Setenvif user-agent "^googlebot" Google Deny from Env=google |
Use. htaccess to block a country's IP network segment
Sometimes they may draw the direction of the development of the site, there are not welcome to certain countries to visit, this time the first idea should be to lock the country's IP, but do not know where to start? Because do not know that the country's IP and Ben cannot lock, this time can through the "blockcountry" online tool website generated by the htaccess grammar to block the IP network segment of the country you want to block.
1th Step to block Country (http://www.blockcountry.com) homepage, first you will see a box, there are many countries in the box, please select the country you want to block, you can check, choose to complete, click below the ﹝block now! ﹞。
The 2nd step is to paste the code generated on the Web page into the htaccess file and store it. Apache will return a 403 error for rejected IPs.
7 commonly used. htaccess code to organize IP access for a country