Set lowercase URL for Sitemap.axd

Topics: ASP.NET 2.0, Business Logic Layer, Controls, Themes
May 28, 2014 at 4:24 PM
Hi
how can I set the lowercase characters for the URL of the sitemap.axd of BE.net?

Thanks
Fabry
May 28, 2014 at 4:44 PM
Edited May 28, 2014 at 4:44 PM
I tried to put lowercaseUrls="true" in Web.Config but don't work

<siteMap defaultProvider="PageSiteMap" enabled="true">
  <providers>
    <add name="PageSiteMap" description="The site map provider that reads in the .sitemap XML files." type="BlogEngine.Core.Web.Controls.PageSiteMap, BlogEngine.Core"/>
    <add name="SecuritySiteMap" description="Used for authenticated users." type="BlogEngine.Core.SecuritySiteMapProvider, BlogEngine.Core" securityTrimmingEnabled="true" lowercaseUrls="true" siteMapFile="Web.sitemap"/>
  </providers>
</siteMap>
Jun 5, 2014 at 4:24 PM
Ok i found solution in this link (http://www.informarea.it/post/2014/06/04/BlogEnginenet-impostare-gli-URL-dei-posts-in-minuscolo-nella-Sitemapaxd.aspx)

Here are the steps:

Download Visual Studio 2013 Express

(http://www.asp.net/downloads)

Download the full source code of the current version you are using on your website

BlogEngine.NET 2.8 (source)

(https://blogengine.codeplex.com/downloads/get/666188)

Or go here to find your current version:

(https://blogengine.codeplex.com/SourceControl/list/changesets)

Now edit the file

BlogEngine.Core/HttpHandlers/SiteMap.cs

and replace this code where is POSTS:
writer.WriteElementString("loc", post.AbsoluteLink.ToString());
With this
writer.WriteElementString("loc", post.AbsoluteLink.ToString().ToLower());
Note: You can not just edit this file with out the full source code of your website, you have to have full source
in order to compile it into a .dll

After you edited the file save it.
Go to solution explore and right click on "ReBuild"

What this does is recompile it into the Blogengine.core.dll

Now press Ctrl+F5 to run it to make sure it is running ok
Now upload the updated Blogengine.core.dll into your website.

Now your URL posts in Sitemap.axd will be lowercase

I hope it can help you