2

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!

asked Mar 29, 2018 at 16:03
1
  • Please upload pub folder files from fresh setup and run above command Commented Mar 29, 2018 at 16:08

2 Answers 2

7

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

Teja Bhagavan Kollepara
3,8275 gold badges33 silver badges69 bronze badges
answered Mar 29, 2018 at 17:33
0
3

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 !!

Amit Bera
77.8k21 gold badges127 silver badges240 bronze badges
answered Mar 29, 2018 at 17:10

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.