Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SF_11.0, SF_11.1, SF_11.2, SF_12.0, SF_12.1, SF_12.2, SF_13.0, SF_13.1, SF_13.2, SF_13.3 - https://www.progress.com/documentation/sitefinity-cms/administration-configure-ssl
using System.Linq;
using Telerik.Sitefinity.Abstractions;
using Telerik.Sitefinity.Modules.Pages;
using Telerik.Sitefinity.Pages.Model;
namespace SitefinityWebApp
{
public class ConfigureFrontendPagesRequireSSL
{
public void EnableRequireSSL()
{
PageManager pageManager = PageManager.GetManager();
IQueryable<PageNode> pageNodes = pageManager.GetPageNodes().Where(pn => pn.RootNodeId == SiteInitializer.CurrentFrontendRootNodeId);
foreach (var pageNode in pageNodes)
{
pageNode.RequireSsl = true;
}
pageManager.SaveChanges();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment