Local Community

CSS not loading of sub directory

Hello one and all,

I am currently using Lightning to serve a non-Wordpress application (Statamic v2, alternative to WP). For about a day it worked without a hitch, but since yesterday I’ve been having issues. The front-end loads fine, the HTML, CSS, JS etc. is all loaded and works. However, when I try to open the control panel (which is located at: site.local/cp/) the pages still load but the CSS and JS 404.

My question is if anyone has experienced this too, and if there is a fix for it (I suspect it’s the nginx conf files, but I can’t find anything)

Alternatively I would switch over to Apache, but I don’t know how to with Lightning.

Thank you!

It should also be noted that I didn’t change anything that (I believe) might cause this issue

@Jeroen Could you open the inspector, go to network tab, perform a hard refresh (ctrl + shift +r on windows or cmd + shift + r on mac) and send a screenshot of the result showing the 404s and urls?

@gmcdonald Sure thing!

@Jeroen If you hover over one of the 404 links you should see the full link. Is the correct link showing when you hover? I’m thinking that maybe your assets are being loaded with relative URL’s.

So for example instead of:
http://mywebsite.com/assets/main.css

It may be trying to load from:
http://mywebsite.com/adminpage/assets/main.css

@gmcdonald

For the cp.css?v=2.11.15
http://nbslasupport.local/index.php/_resources/cp/css/cp.css?v=2.11.15

@Jeroen “The front-end loads fine” - if this is still the case, could you check the link in the inspector for the same CSS file above? So that we can compare the front end link & the back end link. If the links are different, we’ve found the issue

@gmcdonald This is indeed still the case, here is the link to the custom css file (the other css files are loaded externally).

http://nbslasupport.local/site/themes/buzz-core/css/buzz-core.css

@Jeroen would you mind enabling “live link” and mailing me the link so that I can have a look myself?

@gmcdonald I would, but I don’t have the rights to send DM’s yet