R.A. Epigonos et al.

[xhtml] DOCTYPEが"XHTML 1.1 plus MathML 2.0 plus SVG 1.1"の場合のContent-Typeを.htaccessで設定

googleからの検索ヒットが低下している理由を探したら、DOCTYPEとcontent-typeの不一致が原因のひとつと考えられるといわれたので。

"XHTML 1.1 plus MathML 2.0 plus SVG 1.1"文書の公式サンプルはhttp://www.w3.org/TR/2002/WD-XHTMLplusMathMLplusSVG-20020809/sample.xhtmlにある。これを元に返すべきContent-typeをチェックすると"Content-Type: application/xhtml+xml; charset=utf-8"ということが判る。

$ wget  -O/dev/null -S "http://www.w3.org/TR/2002/WD-XHTMLplusMathMLplusSVG-20020809/sample.xhtml"
--2011-04-01 16:00:22--  http://www.w3.org/TR/2002/WD-XHTMLplusMathMLplusSVG-20020809/sample.xhtml
Resolving www.w3.org... 128.30.52.37
Connecting to www.w3.org|128.30.52.37|:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Date: Fri, 01 Apr 2011 07:00:22 GMT
  Server: Apache/2
  Last-Modified: Fri, 09 Aug 2002 15:45:12 GMT
  ETag: "2c22-3a7c94a99f200"
  Accept-Ranges: bytes
  Content-Length: 11298
  Cache-Control: max-age=31536000
  Expires: Sat, 31 Mar 2012 07:00:22 GMT
  P3P: policyref="http://www.w3.org/2001/05/P3P/p3p.xml"
  Connection: close
  Content-Type: application/xhtml+xml; charset=utf-8
Length: 11298 (11K) [application/xhtml+xml]
Saving to: “/dev/null”

100%[======================================>] 11,298      49.1K/s   in 0.2s

2011-04-01 16:00:22 (49.1 KB/s) - “/dev/null” saved [11298/11298]

そこで以下の内容を.htaccessに追記する。

AddType "application/xhtml+xml; charset=UTF-8" .html

追記後にチェックすると以下のような結果が得られる。これで公式サンプルと同じcontent-typeを出力するようになった。

$ wget  -O/dev/null -S "http://za.toypark.in/html/2006/05-18.html"
--2011-04-01 16:00:24--  http://za.toypark.in/html/2006/05-18.html
Resolving za.toypark.in... 202.94.135.219
Connecting to za.toypark.in|202.94.135.219|:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Date: Fri, 01 Apr 2011 06:59:09 GMT
  Server: Apache/2.2.3 (CentOS)
  Last-Modified: Sun, 20 Mar 2011 00:35:50 GMT
  ETag: "1d981e2-18e0-315e4580"
  Accept-Ranges: bytes
  Connection: close
  Content-Type: application/xhtml+xml; charset=utf-8
  Content-Language: ja
Length: unspecified [application/xhtml+xml]
Saving to: “/dev/null”

    [ <=>                                   ] 6,855       --.-K/s   in 0.02s

2011-04-01 16:00:24 (368 KB/s) - “/dev/null” saved [6855]

リファレンス

  1. application/xhtml+xmlなサイト - 徒委記
  2. application/xhtml+xml XHTML 1.1 plus MathML 2.0 plus SVG 1.1 - Google 検索
  3. Media type と HTML lint について
  4. charset utf8 application/xhtml+xml .htaccess - Google 検索
  5. どうしてもgoogleモバイルにキャッシュ・インデックスされません - ウェブマスター 公式ヘルプフォーラム
  6. google xml|xhtml キャッシュ - Google 検索

ソーシャルブックマーク

  1. はてなブックマーク
  2. Google Bookmarks
  3. del.icio.us

ChangeLog

  1. Posted: 2009-11-13T16:10:52+09:00
  2. Modified: 2009-11-13T16:10:52+09:00
  3. Generated: 2023-08-27T23:09:11+09:00