Created
October 23, 2018 10:39
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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