• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Index page wont load css and js

JordanH

Well-known member
#1
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:

https://www.gamingsection.net 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 gamingsection.net when it should be www.gamingsection.net

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

https://www.gamingsection.net/members/jordan.184/



As you can see the base url works fine now.

How come the index page is not loading properly?
 

JordanH

Well-known member
#3
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.
 

Mike

XenForo developer
Staff member
#4
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.
 

JordanH

Well-known member
#5
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
#7
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.