sitefinity 4.x ProcessSSLRedirect?

Posted by Community Admin on 05-Aug-2018 09:53

sitefinity 4.x ProcessSSLRedirect?

All Replies

Posted by Community Admin on 17-Jan-2012 00:00
Hi,

In Sitefinity 3.7 there was ProcessSSLRedirect of Telerik.Cms.Web.CmsHttpModule that we could override and control HTTP/ HTTPS regardless page Require SSL property. We used this because part of site pages were supposed to work under HTTPS only in specific cases (e.g. after user has logged in) while in other cases they were supposed to work under regular HTTP. So, as you can see we could\n't use Require SSL, property which was always redirected specific page to HTTPS.

Does Sitefinity 4.x has this ProcessSSLRedirect (or similar) method available that can be override for controlling HTTP / HTTPS over a sitefinity 4.x site?

If not, which is the best solution for controlling HTTP / HTTPS regardless Require SSL, which will force specific page to always work under HTTPS?

Thanks.

Posted by Community Admin on 19-Jan-2012 00:00
Hi,

To use SSL is to install a SSL certificate in IIS and use SSL across the site, however regarding the use of both secured and unsecured pages Sitefinity doesn`t provide a specialized way to do this. This should be done as in standard .net web application and I was searching for a good way to do and found the redirection with HttpContext.Current.Request.

ublic static string GetSiteRoot()
 
 
  string port = System.Web.HttpContext.Current.Request.ServerVariables["SERVER_PORT"];
 
  if (port == null || port == "80" || port == "443")
 
    port = "";
 
  else
 
    port = ":" + port;
 
   
 
  string protocol = System.Web.HttpContext.Current.Request.ServerVariables["SERVER_PORT_SECURE"];
 
  if (protocol == null || protocol == "0")
 
    protocol = "http://";
 
  else
 
    protocol = "https://";
 
   
 
  string sOut = protocol + System.Web.HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + port + System.Web.HttpContext.Current.Request.ApplicationPath;
 
   
 
  if (sOut.EndsWith("/"))
 
  
 
    sOut = sOut.Substring(0, sOut.Length - 1);
 
  
 
   
 
  return sOut;
 

All the best,
Stanislav Velikov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
This thread is closed