magento pointing to incorrect CSS files in MEDIA folder

Posted on 2011-10-25
Last Modified: 2013-11-18

I recently migrated from servers and also went from Magento 1.5 to 1.6.

I followed all the steps in a migration guide and the site seems to be pulling the correct data from the database, however no style are brought in.

When i look at the source it appears to be pointing to incorrect css files: (they dont exist)

I suspect this has something to do with the encryption key in app/etc/local.xml ?? but im pretty sure that the key is identical to the one from the previous server.

The URL doesnt currently resolve, therefore to view the problem you would need to add this line to your HOST file:

Any suggestions would be greatly appreciated
Question by:Dean OBrien
    LVL 42

    Expert Comment

    by:Chris Stanyon
    Hi Easynow,

    It's not to do with the encryption key, but a setting that combines all your CSS files into 1 in order to add performance to the site. In the backend, go to System -> Configuration -> Developer and you'll see a section for CSS, and an option to combine them into one.

    Untick that, save it, and reload your site (you may need to clear down your cache (System -> Cache Management).

    Look at the source of your site once reloaded and you should see the individual stylesheets again.

    If you want to recombine then, follow the above steps but tick the box and save. This will then generate the correct CSS file for you and put it in the media folder.

    LVL 12

    Author Comment

    by:Dean OBrien
    hey chris

    I had come across a blog post which pretty mush said the same thing.

    I accessed configuration -> developer via back end and i thought i changed the settings to no avail. But further to your post i have went back and they were still set to YES. The problem is there is also no style on the back end. I click "save config", but nothing appears to happen....

    See attahed screen grab.

    Any suggestions? can this setting be changed via the database?

    Easynow astrid screen grab
    LVL 42

    Expert Comment

    by:Chris Stanyon

    That is a bit of a problem. When you combine the stylesheets, it also combines the admin ones. Basically it takes all your css stylesheets from your CSS folder within your theme and then creates and uses the weird named ones that you'll see in your source code. It puts them in the public_html/media/css folder.

    I don't know where in the database these settings are stored.

    Your best bet, if you still have access to the old server configuration is to grab the various css files contained in public_html/media/css and copy them to your new server (same location)

    You may also need to do this with Javascript if you combined your JS files (which would explain why your submit button isn't working - it's coded to submit the form by Javascript!

    Let me know if you still have problems and I'll see what else I can do.

    LVL 42

    Expert Comment

    by:Chris Stanyon
    Found the setting in the database

    The setting is in this table:


    Look for a row that has a 'path' value of 'dev/css/merge_css_files' and change the setting to 0

    You might want to run the usual precaution of backing up your database  :)

    Clear down caches and reload your site

    LVL 12

    Author Comment

    by:Dean OBrien
    Hiya, I changed the settings -and that brought back the CSS and JavaScript files for default... But for so
    E reason the theme ones are not loading.... Strange. I have changed the settings in conf -> designs but still not loading. Any ideas? Anyway u answered the first question thanks ;) will award the points in the morning. Easynpw
    LVL 42

    Accepted Solution

    Not really sure...

    When you load your site, and the css files don't show up, have a look at the source code and see what CSS files it's trying to load, and then check your filesystem to make sure they exist.

    If you have Firefox installed as a browser, download the Firebug extension. This will give a whole host of tools that help you debug webpages (not just Magento ones). In Firebug there's a Console tab and this shows you a list of errors your site generated. If you look in there you may see a 404 error (page not found) and it'll tell you what it couldn't find i.e your stylesheets. That may give you some clue as to what Magento is looking for and where it's looking.

    At least your site is partially up and running - no worse feeling than everything breaking and not having a clue why :(

    LVL 12

    Author Closing Comment

    by:Dean OBrien
    Thanks again!

    Another question coming if you got time :)

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    I recently read an article which suggested that 60% of businesses in the U.S. that process credit card details online in order to accept payment for goods or services were not Payment Card Industry security standards (PCI) compliant. This statement …
    Since I am currently running into this issue right now as I type this, I though I would share my experiences with moving a ModX Revolution site from one server to another.  It is not an easy task, but can be accomplished rather easily. The first …
    Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now