We're using an implementation of custom_url_rewrite_outbound in the settings.php file to add the "https://" protocol marker to all links coming out of Drupal.

(The reason behind this is related to load balancing and SSL termination using a Cisco ACE, which I won't go into detail here.)

Anyways, we use this function to do the rewrite

/**
 * Implementation of custom_url_rewrite_outbound
 *
 * Change all generated URLs in Drupal to have HTTPS
 */
function custom_url_rewrite_outbound(&$path, &$options, $original_path) {
        $options['base_url'] = preg_replace('/http:/', 'https:' , $options['base_url'], 1);
        $options['absolute'] = TRUE;
}

This successfully replaces http for https on all links generated by Drupal except those links for CSS and Javascript when you enable the "Optimize CSS" and "Optimize Javascript" in Admin->Settings->Performance. The rest of the page links are fine, just those two are missing the HTTPS.

If you disable the optimization, all the css/javascript links get the https marker added in.

I tried to find where/how Drupal generates the optimized links to see if I could fix it but I don't know where to look.

Any help would be appreciated.

Comments

boblangdon’s picture

subscribe

laureek’s picture

I am having the same issue with the optimized css being linked to the full http:// url, which does not include the stylesheet correctly in Google Chrome on https:// pages. I am going to try this fix: http://drupal.stackexchange.com/questions/10237/insecure-content-warning...

minoroffense’s picture

That might suffice for a temporary fix but not a permanent solution.

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.