ThinkPHP settings prohibit Baidu and other search engine transcoding (simple and practical) _ php instance

Source: Internet
Author: User
This article mainly introduces ThinkPHP settings to prohibit Baidu and other search engine transcoding (simple and practical) related information. If you need it, you can refer to the website's reading on mobile terminals and may encounter transcoding problems, baidu, the boss of domestic search engines, is naturally the leader in technology. Baidu transcoding has been implemented, and some websites have achieved the desired results after transcoding, however, some websites have been processed by Baidu and cannot bear to look directly at them. Many contents are in disorder, and Joe's website has some misoperations. So Joe used the Wordpress MobilePress plug-in and made some Chinese modifications, I feel more suitable for myself than Baidu's transcoding.

Method 1: explicitly declare in HTTP Response, Cache-control: no-transform.

Add 'HTTP _ CACHE_CONTROL '=> 'Private, no-transform' to the config. php file, // control the webpage Cache

Method 2: explicitly declare Cache-control as no-tranform In the meta tag. The format is:

 

The above section describes ThinkPHP settings to prohibit Baidu and other search engine transcoding (simple and practical). I hope this will help you.

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.