Skip to content

Instantly share code, notes, and snippets.

@sitefinitySDK
Created October 23, 2018 10:39
Show Gist options
  • Save sitefinitySDK/5c618260226a4b604aadd6f37150548e to your computer and use it in GitHub Desktop.
Save sitefinitySDK/5c618260226a4b604aadd6f37150548e to your computer and use it in GitHub Desktop.
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, SF_14.0, SF_14.1, SF_14.2, SF_14.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