Quick Fix: Magento not showing any CSS and Images

Today after installation of one of the extension CSS and images of the magento went missing. After searching I have found that website need its static content to be regenerated in order to fix the CSS and images issue. To regenerate the static content of magento website you will need to follow below steps

Move the existing deployed static content by moving the var/generation folder

mv var/generation var/generation-old

To redeploy the static content please run below command

php bin/magento setup:static-content:deploy

By default this will redeploy the static content in en_US locale if you need to deploy it in any specific locale then you will need to mention that locate in the command

magento setup:static-content:deploy en_GB

Once this process is complete clear the cache of magento by removing folder cache from var directory

rm -rvf var/cache

You should now able to see the redeployed content there and your site should show images and CSS files fine.

Leave a Comment