5

このように、robots.txt ファイルと sitemap.xml で非ラテン文字を使用できますか?

robots.txt

User-agent: *
Disallow: /somefolder/

Sitemap: http://www.domainwithåäö.com/sitemap.xml

サイトマップ.xml

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>http://www.domainwithåäö.com/</loc></url>
<url><loc>http://www.domainwithåäö.com/subpage1</loc></url>
<url><loc>http://www.domainwithåäö.com/subpage2</loc></url>
</urlset>

それともこうすればいいの?

robots.txt

User-agent: *
Disallow: /somefolder/

Sitemap: http://www.xn--domainwith-z5al6t.com/sitemap.xml

サイトマップ.xml

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>http://www.xn--domainwith-z5al6t.com/</loc></url>
<url><loc>http://www.xn--domainwith-z5al6t.com/subpage1</loc></url>
<url><loc>http://www.xn--domainwith-z5al6t.com/subpage2</loc></url>
</urlset>
4

3 に答える 3

0

例には、US-ASCII テーブルにない文字を含む URI が含まれているため、それらをパーセント エンコードする必要があります。

Bing の例:

Your URL:
http://www.domain.com/папка/ 

To Disallow: /папка/

Without Percent encoding (Not Compatible):
Disallow: /папка/

With Percent encoding (Compatile):
Disallow: /%D0%BF%D0%B0%D0%BF%D0%BA%D0%B0/

このBing ブログの投稿が役立つ場合があります。

XML サイトマップの場合、非 ASCII 文字を使用できますが、サーバーのエンコーディングの読みやすさに一致するようにエンコードする必要があります。例を含む詳細な説明については、Google によるこのガイドを参照してください。

于 2015-07-28T17:59:00.853 に答える