Правилото е просто. Създаваме сайтмап във вида:
The rule is easy. We have to create a sitemap of type:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://www.example.com/</loc> <lastmod>2005-01-01</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url> <url> <loc>http://www.example.com/something&something</loc> <lastmod>2005-01-01</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url> </urlset>
Проблема е в символа &. Както сте запознати в Joomla страниците най-често съдържат този символ. За да избегмем проблеми при четенето на XML файла просто трябва да заменин този символ с неговия заместите, т.е &
Ето и таблица за всички специални символи в XML:
Character Name | Entity Reference | Character Reference | Numeric Reference |
---|---|---|---|
Ampersand | & | & | &#38; |
Left angle bracket | < | < | &#60; |
Right angle bracket | > | > | > |
Straight quotation mark | " | “ | ' |
Apostrophe | ' | ‘ | " |
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://www.example.com/</loc> <lastmod>2005-01-01</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url> <url> <loc>http://www.example.com/stranica&ne6to_si</loc> <lastmod>2005-01-01</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url> </urlset>
The problem is in the & symbol. As you know in Joomla most of the pages urls contain this symbol. To avoid this problem with the readability of the XML file we have to substitute this symbol with its XML replacement, e.g. &
Here is a table with all the special charachters in XML:
Character Name | Entity Reference | Character Reference | Numeric Reference |
---|---|---|---|
Ampersand | & | & | &#38; |
Left angle bracket | < | < | &#60; |
Right angle bracket | > | > | > |
Straight quotation mark | " | “ | ' |
Apostrophe | ' | ‘ | " |