Home  >  Article  >  php教程  >  ThinkPHP设置禁止百度等搜索引擎转码(简单实用),thinkphp简单实用

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

WBOY
WBOYOriginal
2016-06-13 08:46:07906browse

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

网站在移动端的阅读不可避免的会遇到转码问题,作为国内搜索引擎老大百度,自然要做技术的领头人了,做了百度转码,有些网站经过转码之后达到了想要的结果,但是有些网站经过百度加工后就是不忍直视,很多内容出现了错乱,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>

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

您可能感兴趣的文章:

  • ThinkPHP让分页保持搜索状态的方法
  • ThinkPHP实现ajax仿官网搜索功能实例
  • Thinkphp搜索时首页分页和搜索页保持条件分页的方法
Statement:
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