开发者

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开发者_C百科 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!


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:

CSS doesn't load after migration of magento website

Incorrect Config Results in:

CSS doesn't load after migration of magento website

  • Remember to clear the var/cache folder.


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


Sounds like an issue with your .htaccess file. Minification rewrites are handled there. If you haven't already, make sure your .htaccess file came over in the transfer, and make the appropriate changes if directories or anything else has been changed.


Thanks its helped me i just forget to place / in the end of the path.

Before:

Base URL http://mywebsitename.com

After:

Base URL http://mywebsitename.com/

Its solved all skin/css and admin problem. Cheeers


I solved the issue, by changing the merge css options in the backend to no It was a bit difficult to navigate through backend without css but managed to get there!
System > Configuration > Developer > CSS Settings


If you haven't changed your site information (url and such) in the backend (or in the database) after the migration, this is the likely problem. http://www.siteground.com/tutorials/magento/magento_configuration.htm#base_url
for the database:
in the core_config_data table
change key "web/unsecure/base_url" to your site base url ex. http://yoursite.com
good luck!


Experienced same problem once. The solution: I'd forgotten to put trailing slashes at the end of my base_urls when I'd updated them

System > Configuration > General > Web > Unsecure

Base URL http://mybaseurl.com/

System > Configuration > General > Web > Unsecure

Base URL https://mybaseurl.com/

If you're Admin section is out of bounds you can also set this value in the database in the table core_config_data

Fields: web/unsecure/base_url and web/secure/base_url

Also: Remember to flush your cache after doing this.


Check permissions for the folders like app/etc, var, media folders. Try to give 755 permissions to those folders. Recently I have faced the same problem and I tried with this. Then my site works fine.


Change Permission Of Skin And Media Containing All Folder TO Give Permission 755 And File TO 644


Mine was also the forward slash ( / ) at the end of the url in the sql database. Cleared Cache and it worked perfect.


One answer that has not been given yet that turned out to be the solution to my problem:

When transferring the Magento store from 1 host to another, what usually isn't copied over is the VirtualHost entry. In my case I had to manually recreate this and wrongfully added AllowOverride None. This should be AllowOverride All in order for .htaccess files to be read and processed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜