PHP implementation shield off black hat seo search keyword, seo keyword _php tutorial

Source: Internet
Author: User

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 ...

  • Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.