After installing Magento 2 CE (version 2.17) fresh version. I found following 404 error of the path on following directory pub/media/styles.css. I found some solution over the internet and I tried that, but no one is work for me. Then on the admin panel, Content->Design->Configuration and on the HTML Head section's "Scripts and Style Sheets" field I found following code
<link rel="stylesheet" type="text/css" media="all" href="{{MEDIA_URL}}styles.css" />
But on the following directory, no file exists.
Please help me to get rid of this problem.
2 Answers 2
Try this,
Remove all files with in static folder, not .htaccess, /pub/static/* file. and remove all file with in var/*
Then run,
<mage-root> rm -rf var/*
<mage-root>php bin/magento setup:static-content:deploy
<mage-root>php bin/magento cache:clean
Clear cache, Then check it.
-
Thanks @Rajkumar for the reply. But not works for me. the problem is on directory pub/media/ not pub/static.Shuvankar Paul– Shuvankar Paul2017年08月08日 11:50:13 +00:00Commented Aug 8, 2017 at 11:50
Actually, there is some issue with Magento version or permission, I used this file to load the layout.
https://equaltrue.com/resource/magento/magento2/pub/media/styles.css
Upload the file on root to pub/media