We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: DM Force SSL for EE2

Development and Programming

Darren Miller's avatar
Darren Miller
103 posts
15 years ago
Darren Miller's avatar Darren Miller

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.

       
Ben Parizek's avatar
Ben Parizek
128 posts
15 years ago
Ben Parizek's avatar Ben Parizek

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.

       
jeffpullinger's avatar
jeffpullinger
15 posts
15 years ago
jeffpullinger's avatar jeffpullinger

you may find Brandon’s blog here helpful: http://pixelandtonic.com/blog/making-pt-structure

       
Ben Parizek's avatar
Ben Parizek
128 posts
15 years ago
Ben Parizek's avatar Ben Parizek

Sweet. Thanks for that link. That’s a super-useful post.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.