Jaap Haagmans The all-round IT guy

11Sep/131

If your Magento backend doesn’t seem to load its CSS/JS files correctly, take note

I've had the following problem before, so I should probably have known what the problem was, but I failed to take note the last time. After a Magento migration (to a test location), I quickly had it up and running for the front-end, but the backend (admin section) didn't seem to load CSS stylesheets and/or Javascript files properly. All references to these files did a lookup to "skin/adminhtml/default/..." instead of the full URL (or even a relative path).

When looking around the internet, I found that everyone who was having the same problem simply forgot to flush their cache. So that was not very helpful. Some people had problems because they forgot to add a trailing slash to their web/(un)secure/base_url in core_config_data, which is also a quick fix. I was still having problems though.

Until I started digging through my core_config_data table, looking for a path LIKE '%url%'. And I found this entry:

|      1419 | stores  |        0 | web/unsecure/base_url                   |                                                     |

Hmmm, that looks fishy. On our live environment, it doesn't seem to pose any problems, but here it appears to override our default web/unsecure/base_url setting. So I removed the row and everything was fine.