Sitemaps XML format - sitemaps.org 日本語訳(下)

原文:sitemaps.org - Protocol

サイトマップファイルの置き場所

サイトマップファイルをどこに置くかによって、
そのサイトマップファイルが効力を持つ範囲が決定される。

もし、サイトマップファイルが
http://example.com/catalog/sitemap.xml
に置かれたならば
http://example.com/catalog/
で始まるURLに対しては言及できるが
http://example.com/images/
で始まるURLには言及できない。

http://example.org/path/sitemap.xml
を編集することが許可されている人は、
http://example.org/path/
で始まるURLの情報を供給することが許可されているとみなされる。

下の例は
http://example.com/catalog/sitemap.xml
に含まれることが有効なURLである。

http://example.com/catalog/show?item=23 http://example.com/catalog/show?item=233&user=3453

下はその逆。

http://example.com/image/show?item=23 http://example.com/image/show?item=233&user=3453 https://example.com/catalog/page1.html


注意してほしいのは、サイトマップファイルに載っている全てのURLは同じプロコトルを使用していなければならないこと、同じホスト上になければならないこと。

たとえばウェブサーバーがexample.comにあったら、サイトマップ索引ファイルはhttp://example.com/sitemap.xml。場合によっては、異なったパス用に別のサイトマップファイルを生成する必要がある。

ポートナンバーを付ける場合は、そのサイトマップファイルに含ませるURLには全てポートナンバーをつけなければならない。
たとえばサイトマップファイルのURLが
http://www.example.com:100/sitemap.xml
であれば、記載するURLは
http://www.example.com:100
で始まらなければならない。


サイトマップファイルを有効にするには

下記はサイトマップファイルで使用できる要素や属性を明確に記したXMLスキーマだ。

サイトマップファイル: http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd サイトマップ索引ファイル: http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd


このスキーマに基づいたサイトマップファイルの構成を有効にするのに役立つツールはこちら。

http://www.w3.org/XML/Schema#Tools http://www.xml.com/pub/a/2000/12/13/schematools.html

スキーマに対して有効であることを明示するのには、各XMLファイルに下記を追記する必要があります。

Sitemap:

<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
...
</url>
</urlset>


Sitemap index file:

<?xml version='1.0' encoding='UTF-8'?>
<sitemapindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
...
</sitemap>
</sitemapindex>


サイトマップ用プロトコルを拡張するには

サイトマップ用プロトコルは、名前空間を明示することで拡張することができる。

<?xml version='1.0' encoding='UTF-8'?> <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:example="http://www.example.com/schemas/example_schema"> <!-- namespace extension --> <url> <example:example_tag> ... </example:example_tag> ... </url> </urlset>


クローラーへの知らせ方

一旦サイトマップファイルを作ってウェブサーバーに置いたら、
検索エンジンごとに定めている方法か、HTTPリクエストを使って
サイトマップファイルを提出することによって、
このプロトコルをサポートする検索エンジンに知らせることができる。


0 Comment(s)

コメントする

コメントを投稿

※承認されるまではコメントは表示されません。

名前
メールアドレス
URL
コメント

Profile

Subscribe

(Thanks to "80x15 BBM")

Sponsored Link

第二新卒

第二新卒、既卒の方向け
“いい就職”応援サイト