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.

subdomain for ssl - ee2 how to

December 03, 2010 3:08pm

Subscribe [3]
  • #1 / Dec 03, 2010 3:08pm

    kellypacker

    138 posts

    We have a site with ssl certificate setup on the subdomain and we want to redirect a template group to that subdomain. So it would be secure.example.com.

    I have been reading tutorials, but mostly they are focused on ee 1.6. I can’t find anything specific on 2.0.

    This is what I have done: copied the index.php to the subdomain folder and changed these settings:

    $system_path = '../../../public_html/system/';
    $assign_to_config['template_group'] = 'my_secure_template_group';
    $assign_to_config['template'] = 'index';
    $assign_to_config['site_index'] = 'index.php';
    $assign_to_config['site_url'] = 'https://secure.example.com/';

    My .htaccess is simply

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]

    And it works insofar as the template loads, but the css files don’t load, something is wrong with the paths. The paths to the css files are like this: /css/main.css (they aren’t css templates, just plain css files) and seems like they should load from example.com, but do not.

    Any ideas about where I am going wrong or why this is happening?

  • #2 / Dec 06, 2010 7:33pm

    kellypacker

    138 posts

    anyone?

  • #3 / Dec 07, 2010 6:24pm

    Ian Beck

    76 posts

    If your media paths are absolute like you suggest then the browser is trying to load them from your subdomain. So you have this in the template:

    <link href="/css/main.css" />

    And the browser tries to load this:

    <a href="https://secure.example.com/css/main.css">https://secure.example.com/css/main.css</a>

    Which doesn’t work, of course, since those files live at the (www.)example.com subdomain.

    I would do an .htaccess rewrite to get this working if I were you, since you need all the resources on the page to load from the secure subdomain (or risk error messages in the user’s browser).

  • #4 / Dec 07, 2010 6:30pm

    joann22

    176 posts

    If running off of https://secure.domain.com, everything on the page that loads under SSL must also appear to be from https://secure.domain.com.  If your css, images, etc, are loaded elsewhere the browser will warn the user that not everything is secure.

    .htaccess is one way to do rewrites

    I’ve also used symbolic links or symlinks.

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

ExpressionEngine News!

#eecms, #events, #releases