Feature Request: SSL redirect

Permalink 1 user found helpful
It would be useful to have the ability to set up certain pages to be kicked over to ssl for example forms.

I would see it working as follows:
SSL url defined within the sitewide settings url. Along with this you would be able to force the whole site to go to SSL.

If the SSL url is present, the attribute "Force SSL" will be avail on all pages. When checked, the page will be served using the SSL url.

lphillips
 
Exposure101 replied on at Permalink Reply
Exposure101
YES! This would be an excellent feature, I'm trying to figure out how to impletment it now. But I definitely think this should be addressed...maybe as a payed addon for $10 or something
clintre replied on at Permalink Reply
clintre
I agree this is something that would be useful and is needed for business sites.
Fernandos replied on at Permalink Reply
Fernandos
you can already do that. I just requires a different autonav block template.
lphillips replied on at Permalink Reply
lphillips
Just changing the block template would be a bit of a hack if you only want a few pages to be SSL enabled. Plus the content editor would need to be aware of it when adding links withing a body of text.

Direct links from google etc would also still get to the non https version which is obviously undesireable...
ideasponge replied on at Permalink Reply
ideasponge
Not at all. Here is a simple solution for making some pages SSL.

1st add a Page attribute with the handle of "force_ssl"

Then add this code
if($_c->getCollectionAttributeValue('force_ssl'))
            $pageLink = 'https://'.$_SERVER['HTTP_HOST'].$pageLink;

To line 61 of your AutoNav view.php (or custom template). It should be added right below this code

if (!$pageLink) {
            $pageLink = $ni->getURL();
         }
lphillips replied on at Permalink Reply
lphillips
While this would make links from this auto nav SSL, it wouldn't help when a content editor or some other page list block links to the non ssl version. Then if it were to get indexed by google it'd be very difficult to remove the index.

I'm talking about a force ssl here - not just directing the user to ssl. If you're dealing with sensitive data you should be ensuring that the page is definately served up in ssl - Having a non ssl version that someone can link to/be linked to just isn't very good practice...
ideasponge replied on at Permalink Reply
ideasponge
ok then add the page attribute and then add this to the top of the Theme file
if($c->getCollectionAttributeValue('force_ssl')){
   header ("Location:http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
   exit;
}


I do think that if this kind of force redirect was part of c5 it would be much better. But at least this works.

EDIT: Odd, I have "https" in that redirect code but for some reason it shows up as http.
lphillips replied on at Permalink Reply
lphillips
Well no, i get that i can do it - i've worked around it. But this would be a useful feature to have for future projects etc. Hence the FR ;)
jaksco replied on at Permalink Reply
Exactly. I don't mean to bring up an old discussion, but this would really be a nice feature to have even as a page attribute.