HTTPS login only from frontside

By ht1080z - September 15, 2012


I am working on a new project with 2.17 and membership plugin 1.07.
For the CMSBuilder admin panel (from settings) i can restrict HTTPS login only, but for the front side users how can i enable this restriction login feature?

Thank you in advance,

Re: [ht1080z] HTTPS login only from frontside

By gregThomas - September 17, 2012

Hi Karls,

The best way to force a user to log-in securely is to place the following PHP code at the top of your log-in page, or any page you want the user to be able to only visit using https:

if (preg_match('/^http:/i', thisPageUrl())) { redirectBrowserToURL(preg_replace('/^http:/i', 'https:', thisPageUrl())); }
This will force the page to redirect to HTTPS. I would also recommend changing any links to the page from http:// to https://, but this is not essential as the php code above will force the change anyway.


Greg Thomas

PHP Programmer -