PHP implementation to shield off Black hat seo search keywords, seo key words
Believe that a lot of webmasters have encountered this situation: the site's search function is used by bad molecules, through the search box in the site constantly search for sensitive keywords, generating a large number of title on the page with sensitive keywords spam search results (such as). Because Baiduspider to each site crawl amount is limited, so these spam search results page is included in Baidu, will lead to other meaningful pages because of quota issues not to be included, and may be due to Baidu processing garbage page and affect the normal ranking of the site.
For specific reference Baidu official page http://zhanzhang.baidu.com/college/articleinfo?id=117
I'll give you a way of thinking about me
The idea is that the big guys want to do this stuff. Most still want to leave QQ or phone number
So I'm going to match the rules inside. Find the numbers in the search and then judge the length of the number string to determine if it's a spam search.
On the code:
<?php//@ function shield off black hat seo search keywords//@By yang brother function findnum ($str = ") {//Remove all the numbers inside the string $str =trim ($STR); if (empty ($STR)) {return ';} $result = "; for ($i =0; $i
6) {//Determine if the length is more than 6 over the direct 301 to the search page header ("http/1.1 301 Moved permanently"); Header ("location:http://". $_server[' Http_host '). " /search.php "); Exit ();}? >
The above mentioned is the whole content of this article, I hope you can like.
http://www.bkjia.com/PHPjc/984620.html www.bkjia.com true http://www.bkjia.com/PHPjc/984620.html techarticle PHP implementation to shield off the black Hat seo search keywords, seo keywords believe that many webmasters have encountered this situation: the site's search function is used by bad molecules, through the search box in the station constantly ...