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.

Comments (1) Trackbacks (0)
  1. Hey, I just wanted to leave a message that years later, this tip really came in handy. I was helping someone that copied a live store to a staging store and they not only ran into css not loading but redirect loops when logging into the admin area. Sure enough, they had a store view in cope_id 0 (which is admin) that had empty BaseUrls. In my case, I made them identical to the ‘default’ scope_id URLs, and that fixed it as well. Been supporting magento quite a while now and this is the first time I ran into this, so this was a handy post. Thanks!

    -Bug


Leave a comment

No trackbacks yet.