If like me you've changed the routing from p > products & c > category the sitemap generator will still output the old routes. I needed to amend the SitemapGenerator.cs file in the Services project.
private void WriteCategories(int parentCategoryId)
{
var categories = _categoryService.GetAllCategoriesByParentCategoryId(parentCategoryId, false);
foreach (var category in categories)
{
//TODO add a method for getting URL (use routing because it handles all SEO friendly URLs)
// Change from c to category
var url = string.Format("{0}category/{1}/{2}", _webHelper.GetStoreLocation(false), category.Id, category.GetSeName());
var updateFrequency = UpdateFrequency.Weekly;
var updateTime = category.UpdatedOnUtc;
WriteUrlLocation(url, updateFrequency, updateTime);
WriteCategories(category.Id);
}
}
private void WriteManufacturers()
{
var manufacturers = _manufacturerService.GetAllManufacturers(false);
foreach (var manufacturer in manufacturers)
{
//TODO add a method for getting URL (use routing because it handles all SEO friendly URLs)
// Change from m to manufacturer
var url = string.Format("{0}manufacturer/{1}/{2}", _webHelper.GetStoreLocation(false), manufacturer.Id, manufacturer.GetSeName());
var updateFrequency = UpdateFrequency.Weekly;
var updateTime = manufacturer.UpdatedOnUtc;
WriteUrlLocation(url, updateFrequency, updateTime);
}
}
private void WriteProducts()
{
var products = _productService.GetAllProducts(false);
foreach (var product in products)
{
//TODO add a method for getting URL (use routing because it handles all SEO friendly URLs)
// Change from p to products
var url = string.Format("{0}products/{1}/{2}", _webHelper.GetStoreLocation(false), product.Id, product.GetSeName());
var updateFrequency = UpdateFrequency.Weekly;
var updateTime = product.UpdatedOnUtc;
WriteUrlLocation(url, updateFrequency, updateTime);
}
}
Recompile the project and add the services.dll into the BIN folder. Your SitemapGenerator will now output the correct links.