Skip to content

Instantly share code, notes, and snippets.

@hissy
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hissy/dfe3a512a744318da850 to your computer and use it in GitHub Desktop.
Save hissy/dfe3a512a744318da850 to your computer and use it in GitHub Desktop.
[concrete5] Force SSL when user is logged in
<?php
// Add below codes into config/site.php
// If User is logged in
if (isset($_SESSION['uID']) && $_SESSION['uID'] > 0 && isset($_SESSION['uName']) && $_SESSION['uName'] != '') {
define('BASE_URL', 'https://example.com');
} else {
define('BASE_URL', 'http://example.com');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment