Intermittently wrong hostnames in css references, why?

I’m an operator of an OJS installation (customized locally, based on version 2.4.6 I think, I don’t know the details).

We have an intermittent problem with “wrong” hostnames in css references, causing pages to be shown without styling, since we only have a SSL certificate for the “correct” hostname (not any aliases).

Example (right now shown without styling, might not apply when you read this): .

The hostname “” shown in the above URL is correct, but page source shows:

<link rel="stylesheet" href="" type="text/css" />
<link rel="stylesheet" href="" type="text/css" />
var base_url = "";

The “wrong” hostname “” is pointing to the same host as “” (for historic reasons).
There are also some apache RewriteRules in play, e.g. all http requests are rewritten to https.

Our has the correct hostname in:

base_url = ""

What can cause css references (and base_url) having a different hostname than the (correct) page URL hostname?
Any ideas are appreciated.

/ Peter

Solution in this case was to redirect all SSL requests to the correct host (

@peterny, your solution sounds correct. Alternately, you could add subject alternate names to the certificate. OJS will not itself automatically force a request to the specified base_url if the webserver allows multiple aliases.