I deleted the pub folder of my magento installation. Then I used
php bin/magento setup:static-content:deploy
and now the site has no CSS at all. How can I fix that?
Thanks!
I deleted the pub folder of my magento installation. Then I used
php bin/magento setup:static-content:deploy
and now the site has no CSS at all. How can I fix that?
Thanks!
Don't delete the entire pub
folder. Delete pub/static/*
if/when needed.
You are most likely missing three critical files that will not be automatically regenerated:
pub/.htaccess
pub/media/.htaccess
pub/static/.htaccess
If you have a backup or a local dev site, I suggest finding and restoring them from there. Otherwise, you can find them in the appropriate branch of the Magento github repository (depending on what version you are running): https://github.com/magento/magento2
Well if you have deleted pub folder then even though you run
php bin/magento setup:static-content:deploy
It will still not generate, because if its pub/static then it will generate automatically.
So better to create pub directory manually again
Then upload media folder in it from your backend.
Then run php bin/magento setup:static-content:deploy -f
It will generate static folder again and css is also load back again !!