sitefinity 4.x ProcessSSLRedirect?
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.
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;