Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS doesn't load after migration of magento website

I migrated my magento website to a different server, following the steps described here. Everything went smoothly, except for the fact that when I load the page, the CSS won't load, and I just get the page in plain text.

I used firebug and noticed that the path the system is using to get to the CSS file doesn't exist in the FTP server. It starts with the 'minify' folder, which makes me think that something might be cached from the previous server.

An example:

my_site_url/minify/1281335374/skin/frontend/default/hellouno/css/styles.css

This path doesn't exist, not even in the previous server, so I'm thinking maybe these files are supposed to be generated on the fly? I'm really confused, any help will be very appreciated!

like image 999
Rafa Avatar asked Nov 28 '22 11:11

Rafa


2 Answers

In my case, the problem was a missing Slash "/" at the end of the domain.

Use the following to get both rows:

SELECT * FROM core_config_data WHERE path = 'web/unsecure/base_url' OR path = 'web/secure/base_url';

Then update them manually and make sure the domain has it's final "/", otherwise it will merge the domain name with the following folder name.

You can check whether this is your condition if when doing inspect, you see a wrong path to CSS and JS.

Correct Config:

enter image description here

Incorrect Config Results in:

enter image description here

  • Remember to clear the var/cache folder.
like image 114
Eduardo Chongkan Avatar answered Dec 11 '22 12:12

Eduardo Chongkan


I'm going to assume you cleared your cache out. If "not having CSS" makes this hard to do via the admin, just delete the

var/cache

folder.

Sometimes giving the CSS (or Javascript) merge settings a quick toggle from on, to off, to on again will force Magento to recalculate the paths.

System -> Developer -> CSS Settings

If you can't access this in the Admin, change the value manually in the database table core_config_data (identified by the path column having the value dev/css/merge_css_files), clear your cache and reload your page

like image 28
Alan Storm Avatar answered Dec 11 '22 11:12

Alan Storm