To address one of your initial comments:
"I have set Product URL Suffix(html) and Category URL Suffix(html) in the configuration.
This suffix are not showing in sitemap.xml."
We noticed this bug introduced in EE 1.13. We requested a patch and received the following. I don't believe this is EE specific so hopefully it helps a bit. Also, just upgraded a EE 1.12 site to 1.14 and noticed all the .html extension were dropped from sitemap.xml as well. Yes, having .html is old school and really not of any seo value these days but this bug can really suck if it goes unnoticed.
Warning ... I did not look at the referenced file in community. Use this as a guide, do not try to apply the patch blindly to your community store. Or if you do, at least test it very thoroughly before going live.
__PATCHFILE_FOLLOWS__
diff --git app/code/core/Mage/Sitemap/Model/Sitemap.php app/code/core/Mage/Sitemap/Model/Sitemap.php
index 2213a4f..734bb91 100644
--- app/code/core/Mage/Sitemap/Model/Sitemap.php
+++ app/code/core/Mage/Sitemap/Model/Sitemap.php
@@ -151,11 +151,13 @@ class Mage_Sitemap_Model_Sitemap extends Mage_Core_Model_Abstract
*/
$changefreq = (string)Mage::getStoreConfig('sitemap/category/changefreq', $storeId);
$priority = (string)Mage::getStoreConfig('sitemap/category/priority', $storeId);
+ $urlSuffix = Mage::helper('catalog/category')->getCategoryUrlSuffix($storeId);
+ $urlSuffix = ($urlSuffix) ? '.' . $urlSuffix : '';
$collection = Mage::getResourceModel('sitemap/catalog_category')->getCollection($storeId);
foreach ($collection as $item) {
$xml = sprintf(
'<url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%.1f</priority></url>',
- htmlspecialchars($baseUrl . $item->getUrl()),
+ htmlspecialchars($baseUrl . $item->getUrl() . $urlSuffix),
$date,
$changefreq,
$priority
@@ -169,11 +171,13 @@ class Mage_Sitemap_Model_Sitemap extends Mage_Core_Model_Abstract
*/
$changefreq = (string)Mage::getStoreConfig('sitemap/product/changefreq', $storeId);
$priority = (string)Mage::getStoreConfig('sitemap/product/priority', $storeId);
+ $urlSuffix = Mage::helper('catalog/product')->getProductUrlSuffix($storeId);
+ $urlSuffix = ($urlSuffix) ? '.' . $urlSuffix : '';
$collection = Mage::getResourceModel('sitemap/catalog_product')->getCollection($storeId);
foreach ($collection as $item) {
$xml = sprintf(
'<url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%.1f</priority></url>',
- htmlspecialchars($baseUrl . $item->getUrl()),
+ htmlspecialchars($baseUrl . $item->getUrl() . $urlSuffix),
$date,
$changefreq,
$priority
Are you using "sitemap.xml" as the filename? Magento gives you the option to enter a custom filename, but for some reason it will throw an error when you enter a different name.
If you have multiple stores, you can add them in different folders (like /en_US/ and /fr_FR/) and still set the filename to sitemap.xml.
If that isn't working either, there is something wrong with the write permissions of your file (or the owner).
Best Answer
Put your sitemap in the
/pub/
folder:Then go to http://www.domain.com/sitemap.xml