ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Is this a workable {site_url} http:// vs https:// solution?

May 13, 2009 10:35am

Subscribe [3]
  • #1 / May 13, 2009 10:35am

    Hal Lesesne

    2 posts

    I’ve appended something similar to the following to my config.php file:

    if ($_SERVER['SERVER_PORT']!=443) {
    $conf['site_url'] = "http://myurl.com/";
    } else {
    $conf['site_url'] = "https://myurl.com/";
    }

    Everything seems to function correctly now when I switch between http and https access to my site and I don’t get any more mixed nags when I use the {site_url} token in my templates on https access.

    I’m wondering if there is any downside to this solution - other than not being able to set the site_url in the control panel?

    Thanks,

    Hal

  • #2 / Jun 06, 2009 1:11pm

    Eric Snyder

    202 posts

    Well…I see you didn’t get any answer. I just ran across this today. It seems a great idea to me. Did you ever see any downsides?

  • #3 / Jun 08, 2009 12:44pm

    Hal Lesesne

    2 posts

    Nope - no downside at all.

    I made several modifications to config.php to allow for those application variables to be determined dynamically and everything seems to work great.

    Thanks,

    Hal

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases