Home > Backend Development > PHP Tutorial > ThinkPHP settings to prohibit Baidu and other search engines from transcoding are simple and practical

ThinkPHP settings to prohibit Baidu and other search engines from transcoding are simple and practical

WBOY
Release: 2016-07-29 09:03:21
Original
1133 people have browsed it

Reading websites on mobile terminals will inevitably encounter transcoding problems. As the leader of domestic search engines, Baidu naturally needs to be a leader in technology. Baidu transcoding has been done. Some websites have achieved the desired results after transcoding. , but some websites cannot bear to be looked at directly after being processed by Baidu. Many contents are confused, and Joe's website also has some misalignments, so Joe used the WordPress plug-in MobilePress. After some Chinese modifications, he felt that it was more suitable for him than Baidu's transcoding. .

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

Add 'HTTP_CACHE_CONTROL' to the config.php file => 'private,no-transform', // Web page cache control

Method 2: Explicitly declare Cache-control as no-tranform in the meta tag, the format is:

<head>
<meta http-equiv="Cache-Control" c/>
</head>
Copy after login

The above is the ThinkPHP setting introduced by the editor to prohibit Baidu and other search engines from transcoding ( Simple and practical) related content, I hope it will be helpful to everyone.

The above is a simple and practical introduction to ThinkPHP settings to prohibit search engine transcoding such as Baidu, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template