Sign up ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I have a theme and am loading CSS in the traditional way, through the theme.info file, as follows:

stylesheets[all][] = css/style.min.css

However, my clients site uses HTTPS. And every 3rd or 4th load for some reason Drupal tries to load all my files via HTTP rather than HTTPS, causing all the stylesheets/js/images not to load.

Is there any way to force Drupal to use HTTPS on assets while maintaining using the theme.info file to load them?

share|improve this question
    
Is it pure SSL? Or SSL/Non-SSL mix mode? Do you use securepages module? –  Beebee Jul 24 '13 at 14:37

3 Answers 3

That could be a caching issue where a client requesting a page over HTTPS gets a cached copy that was generated over HTTP and thus has HTTP links in it. I'm afraid I can't recommend an exact solution because it depends on the caching engine being used.

share|improve this answer
    
The standard Drupal page cache is keyed on the full url, i.e. the http and https versions of the page are different, so this wouldn't normally be an issue. If this is the issue, then it's likely because you have something in front of drupal that converts the https to http. If that's the case, they you'll want to be consistent about anonymous page access to your site, i.e. force all urls to be http or https. –  Alan Dixon Aug 31 at 13:53

One option is to use AdvAgg as this will generate different aggregate filenames for http and https. If the issue is the cache then advagg will not fix it though.

share|improve this answer

You might need to set the base url in your settings.php file, specifying https:

$base_url = 'https://my.domain.name';

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.