Removing or Changing Sitefinity Page Extensions
When migrating to the latest Sitefinity from the old version 3.7, by default the original .aspx page extension remains intact. It is stored in the Extension property of the PageNode.
You can remove (or change) this extension with this simple code snippet:
using (var api = App.WorkWith())
{
var pages = api.Pages().LocatedIn(PageLocation.Frontend).ThatArePublished()
.ForEach(page =>
{
page.Extension = null;
}).SaveChanges();
}
RemoveSitefinityPageExtensions.cs on Gist
The following two tabs change content below.
selaromdotnet
Senior Developer at iD Tech
Josh loves all things Microsoft and Windows, and develops solutions for Web, Desktop and Mobile using the .NET Framework, Azure, UWP and everything else in the Microsoft Stack. His other passion is music, and in his spare time Josh spins and produces electronic music under the name DJ SelArom.
His other passion is music, and in his spare time Josh spins and produces electronic music under the name DJ SelArom.
Latest posts by selaromdotnet (see all)
- Restarting a Specific Azure Web App Instance - January 13, 2021
- Adding Ratings and Reviews to Sitecore Commerce with YotPo - November 13, 2018
- Sourcetree Suddenly Prompting for Github Credentials - February 22, 2018