In my sitecore website, I need few pages to be SSL enabled. (User profile, Login, Create data etc). But I want to leave browsing related pages normally.
Is there a Sitecore configuation to do this, or how can I do this?
In my sitecore website, I need few pages to be SSL enabled. (User profile, Login, Create data etc). But I want to leave browsing related pages normally.
Is there a Sitecore configuation to do this, or how can I do this?
假设您使用的是 Sitecore 6.0+,请查看 Sitecore 市场中的SSL Redirector 模块。
该模块将允许您指定您想要保护的特定页面(实际上是模板)。我认为这正是您正在寻找的。
我们采取的一种方法是:
最后编写自定义代码来修改 HttpRequest Pipeline。
using Sitecore;
using Sitecore.Data.Fields;
using Sitecore.Pipelines.HttpRequest;
public class HttpsRequestBegin
{
public void Process()
{
Sitecore.Data.Items.Item item = Context.Item;
if (item != null && item.Fields["Https"] != null)
{
Sitecore.Data.Fields.CheckboxField httpsEnabledCheckbox = new CheckboxField(item.Fields["Https"]);
if (httpsEnabledCheckbox.Checked)
{
// Do Stuff
}
}
}
}
希望以上有所帮助。