Index page wont load css and js


Well-known member
I recently changed servers and now whenever you try to load the index of my page, it does not load the css or the javascript properly.

I do force an SSL on the forum, but I have always had an SSL on it so I do not think that is the problem. because of the css and js not loading properly, SSL also indicates the forum is not secure.

From what I can see, the base URL is not working properly anymore. Heres what I mean: here you can see the index, broken. Here is what the html looks like:

Notice how the base url is http:// (not https) and its when it should be

Heres what all my other pages look like, for example my profile page:


As you can see the base url works fine now.

How come the index page is not loading properly?


Well-known member
That had not helped at all.

I do know one thing, the server change went from apache to lightspeed if that means anything.

My PAGE_CONTAINER was edited, and I did revert it. Did not do anything.

I also added your $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_REAL_IP']; which did not do anything as well.

But like I said, other pages load fine. How come its just the index? Also, so far still no fix.


XenForo developer
Staff member
Different servers expose HTTPS to PHP differently. I suspect, for some reason, it's simply not doing that on the index page.

You can probably just add this to your config.php:

$_SERVER['HTTPS'] = 'on';

Does that fix it? Note that will only work if you always use SSL on the forums.


Well-known member
Sadly that does not work either :(

The thing is. It worked fantastic with no errors or nothing wrong before I transferred to this new server.

Jake Bunce

XenForo moderator
Staff member
There was an index.html file in the forum root which contained the page with the bad base href which was failing to load the CSS. I renamed the file to index.html.bak. The problem is solved.