Custom HTTPS Url Routing

Posted by Community Admin on 04-Aug-2018 06:51

Custom HTTPS Url Routing

All Replies

Posted by Community Admin on 04-Mar-2012 00:00

Is there a way that I can override Sitefinity's HTTP / HTTPS handling so that I can direct to HTTPS in my own URL routing?

Right now if I try to access a page with HTTPS that is not set to Require SSL I am redirected to the HTTP version, but the only way I can edit a page that is HTTPS is to remove Require SSL, edit the page, and then turn HTTPs back on.

Posted by Community Admin on 07-Mar-2012 00:00

Hello,

One option would be to enable SSL for the entire site including backend and frontend pages which should solve the issues with editing pages set as RequireSSL. However if you want to implement some custom logic (e.g. NAT) that would be a tough one, as there is no logic exposed for checking whether a certain page has RequireSSL set before the routes have executed the only plausible solution would be an HttpModule which will get the request once it's been processed by Sitefinity and check if the request is http or https and then redirect to the desired ports using NAT.

All the best,
Boyan Barnev
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

Posted by Community Admin on 07-Mar-2012 00:00

How would I go about enabling SSL for the entire site. Is that a backend setting or a config?

Posted by Community Admin on 08-Mar-2012 00:00

Hi,

We have just replied to the support thread you had open for the same issue, you can check our response there. For your convenience please find our reply below as well:

"Each Sitefinity page has a public property RequireSSL which can be set from the page's Title and Properties action menu, however if you want to set it in bulk the easiest approach would be through code:

App.WorkWith().Pages()
                           .ThatArePublished()
                           .Where(p => p.Page != null)
                           .ForEach(p =>
                                       
                                           p.Page.RequireSsl = true;
                                       ).SaveChanges();
you can simply place the above sample on a WebForm in your project solution, build it and then navigate to the WebForm int he browser. Please make sure you're logged in Sitefinity with an administrative user as you'll be modifying the Pages properties."

All the best,
Boyan Barnev
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

Posted by Community Admin on 14-Mar-2012 00:00

You can also use the following SQL in the database which doesn't require a code release:

update sf_page_data set require_ssl = 1

We have to do this with every major code release where we're migrating our dev sitefinity DB to prod since our dev server doesn't have https or a cert installed. 

This thread is closed