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
Comment #1
boblangdon commentedsubscribe
Comment #2
laureek commentedI 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...
Comment #3
minoroffense commentedThat might suffice for a temporary fix but not a permanent solution.