For servers with an SSL certificate - this plugin allows you to control whether or not your templates display under https.
The plugin works by redirecting from the http version of the page to https.
To install, place the folder dm_force_ssl in your /system/expressionengine/third_party/ folder
Then, add a variable to your /system/expressionengine/config/config.php file:
$config['force_ssl'] = true;Set this to false to disable to plugin whilst leaving tags in place (for use in non-ssl development environments etc)
Finally, add the required tags to your templates.
There are three tags available, each must be placed at the very top of the template.
force
{exp:dm_force_ssl:force persist_flashdata="key,key,key"}Force a template to use SSL. If, like me, you use a lot of flashdata in your apps, you can ensure that any values persist across the redirect by including their key names, comma separated, in the optional persist_flashdata parameter.
unforce
{exp:dm_force_ssl:unforce}Identical to above, except forces a page to not use SSL. Useful if your navigation is not absolute as it allows an escape from server-hungry SSL requests.
form_paths
{exp:dm_force_ssl:form_paths}This is useful if you need to ensure that any absolute form action paths generated by subsequent {exp} tags (for example Search) retain any current https protocol. No redirect is made, but the core system variables are adjusted.
Project status This plugin is very new (I only realised I needed it this morning) and has not been tested in many different environments, or with many different add-ons (in relation to the form_paths tag). If you find a problem, please post it here and I’ll see what I can do.
Nice. I have a need for something like this at the moment. Is there a reason this method would be preferred to using mod_rewrite in your .htaccess?
I’ve been trying to get this working using .htaccess but haven’t found the proper combo for remove index.php AND redirect to https.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.