<![CDATA[ CSS not loading - MODX Community Forums]]> https://forums.modx.com/thread/?thread=88679 <![CDATA[Re: CSS not loading]]> https://forums.modx.com/thread/88679/css-not-loading?page=3#dis-post-488969 Quote from: fk_abs at Feb 02, 2014, 05:01 PM
Ahhhh ok, that's why clearing the cache solved the problem.

Thank you for your answer ;-)

Thank you for filing this bug report: https://github.com/modxcms/revolution/issues/11100

I have seen this exact same issue in the recent past, and -- until now -- have not been able to track down the source.]]>
pixelchutes Feb 02, 2014, 11:48 AM https://forums.modx.com/thread/88679/css-not-loading?page=3#dis-post-488969
<![CDATA[Re: CSS not loading]]> https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488967
Thank you for your answer ;-)]]>
fk_abs Feb 02, 2014, 11:01 AM https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488967
<![CDATA[Re: CSS not loading]]> https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488966
]]>
sottwell Feb 02, 2014, 10:51 AM https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488966
<![CDATA[Re: CSS not loading]]> https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488964 We all know that HTTP 1.0 requests come without a $_SERVER['HTTP_HOST'] and then, the $http_host variable in the config-file is empty, which causes this error.
Even if you set the base-url manually to your host, this alone will not to the trick unfotunately.

This little "quick and dirty" code did the trick:

/core/config/config.inc.php:

replace
65: $http_host = $_SERVER['HTTP_HOST'];


with
65: $http_host = array_key_exists('HTTP_HOST', $_SERVER) ? $_SERVER['HTTP_HOST'] : 'your_http_host_here';


Really weird that after that 1.0 request, I open the page with my browser (1.1 request) the $http_host still stays empty until I clear the cache.
Is it possible that the $http_host gets saved in the modx-cache?]]>
fk_abs Feb 02, 2014, 09:35 AM https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488964
<![CDATA[Re: CSS not loading]]> https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488960 fk_abs Feb 02, 2014, 05:55 AM https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488960 <![CDATA[Re: CSS not loading]]> https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488959
You can create a context setting for the web context, specifically setting the site_url so that it's constant. Or you can hard-code your full site URL for the base tag's attribute.]]>
sottwell Feb 02, 2014, 05:24 AM https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488959
<![CDATA[Re: CSS not loading]]> https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488958 I found this post from 5 years ago:
http://forums.modx.com/thread/36226/css-and-cache-problem

That's what you're talking about right?
I hope it helps.

The configs are fine jfyi.
I will share the information if this little "fix" from the url above worked out for me, hopefully it helps someone else in the future then.]]>
fk_abs Feb 02, 2014, 05:09 AM https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488958
<![CDATA[Re: CSS not loading]]> https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488955
I have had problems with distributed and cloud servers that aren't quite configured properly, and the base path of the website varies. For example, what is today something like /home/sites1/username/www/ might next week be /home/sites2/username/www/.

One time I had the server admins restore a rather old backup for the whole server without notifying any of the clients on the server. That was a mess. Fortunately I had a current backup for the site, and was able to restore it to a more current state.

]]>
sottwell Feb 02, 2014, 04:51 AM https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488955
<![CDATA[Re: CSS not loading]]> https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488952
The css and javascript files getting loaded now, but the page gets displayed like without them?!
If have really no idea whats going on here, no php-errors, modx-errors or apache-errors.

After clearing the cache everything is like as it should.
Then, 2 weeks later or so, same problem. Page gets displayed without style, but css-files getting loaded.
Clearing the cache "fixes" this again.

I'm pretty sure that's a problem with the modx-cache.
The cache-settings are on standard settings, no expiration times, modx-db-cache not in use.

Does anyone have an idea whats going on here?]]>
fk_abs Feb 02, 2014, 03:17 AM https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-488952
<![CDATA[Re: CSS not loading]]> https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-487929 Quote from: BobRay at Jan 22, 2014, 09:03 AM
It shouldn't matter, but this might solve it:

[[!$head]]

Thanks, I will implement it and see how it works out over time!]]>
fk_abs Jan 22, 2014, 03:17 AM https://forums.modx.com/thread/88679/css-not-loading?page=2#dis-post-487929