ThinkPHP设置禁止百度等搜索引擎转码(简单实用)_php实例

WBOY
Release: 2016-06-07 17:09:14
Original
844 people have browsed it

网站在移动端的阅读不可避免的会遇到转码问题,作为国内搜索引擎老大百度,自然要做技术的领头人了,做了百度转码,有些网站经过转码之后达到了想要的结果,但是有些网站经过百度加工后就是不忍直视,很多内容出现了错乱,Joe的网站也出现了一些错位,于是Joe用了Wordpress插件MobilePress,经过一些汉化修改,感觉比百度的转码更适合自己。

方法1、HTTP Response中显式声明,Cache-control:no-transform.

在config.php 文件中加入 'HTTP_CACHE_CONTROL' => 'private,no-transform', // 网页缓存控制

方法2、meta标签中显式声明Cache-control为no-tranform,格式为:

<head>
<meta http-equiv="Cache-Control" content="no-transform"/>
</head>
Copy after login

以上所述是小编给大家介绍的ThinkPHP设置禁止百度等搜索引擎转码(简单实用)的相关内容,希望对大家有所帮助。

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!