You are here

把英文版Drupal的<header>里面的Content-Language改为zh-cn

修改前的header

HTTP/1.1 200 OK
Date: Sun, 05 Aug 2012 19:46:23 GMT
Server: Apache/2
X-Powered-By: PHP/5.2.17
X-Drupal-Cache: HIT
Etag: "1344193516-0"
Content-Language: en
Link: <http://igfvv.com/>; rel="publisher",<http://igfvv.com/>; rel="shortlink",<http://igfvv.com/>; rel="canonical"
Cache-Control: public, max-age=0
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Vary: Cookie,Accept-Encoding,User-Agent
Last-Modified: Sun, 05 Aug 2012 19:05:16 GMT
Content-Encoding: gzip
Content-Length: 10200
Keep-Alive: timeout=1, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8

修改后

HTTP/1.1 200 OK
Date: Sun, 05 Aug 2012 19:48:27 GMT
Server: Apache/2
X-Powered-By: PHP/5.2.17
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
ETag: "1344196107"
Content-Language: zh-cn
Link: <http://igfvv.com/>; rel="publisher",<http://igfvv.com/>; rel="shortlink",<http://igfvv.com/>; rel="canonical"
Vary: Cookie,Accept-Encoding,User-Agent
Last-Modified: Sun, 05 Aug 2012 19:48:27 GMT
Content-Encoding: gzip
Content-Length: 9987
Keep-Alive: timeout=1, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8

就改一个小地方
includes/common.inc

  // Send appropriate HTTP-Header for browsers and search engines.
  global $language;
  drupal_add_http_header('Content-Language', $language->language);

  // Send appropriate HTTP-Header for browsers and search engines.
  drupal_add_http_header('Content-Language', 'zh-cn');

改好后保存 清空一下缓存(admin/config/development/performance/)就ok鸟

关键字: 
文章类型: