I tried every way(regenerate code, clean cache) I could find but still can't resolve this issue.
I did a fresh installation, and everything works fine, except only pub/media/styles.css 404 Not Found, all other js and css are good when loading homepage.
any idea?
Hi,
There can be two reasons for getting this issue.
Firstly it may be that deploy was not successful. For this first, go to your Magento folder and check for the styles.css file in the pub/media folder. If this file was present then give the pub folder the required rwx permission.
Secondly, if the file was not present then run the deploy command correctly.
Hope this was helpful.
@MuditShukla wrote:Hi,
There can be two reasons for getting this issue.
Firstly it may be that deploy was not successful. For this first, go to your Magento folder and check for the styles.css file in the pub/media folder. If this file was present then give the pub folder the required rwx permission.
Secondly, if the file was not present then run the deploy command correctly.
Hope this was helpful.
Thank you for your reply. Just checked and that file don't exist. I tried to deploy again and again, but only this file missing. Don't know whats happening...
If your magento 2 with path pub/media doesn't contains styles.css file then you have to keep first styles.css file.
Below styles is for styles.css file, Keep Below styles in your pub/media/styles.css file,
you can get file from demo site of magento 2 by Nexcess,
Now run command,
php bin/magento setup:upgrade
After upgrade completes,
Run deploy command,
php bin/magento setup:static-content:deploy
Clear cache and reload page.
If response was helpful to you,Consider giving kudos to the post.
If issue solved, click Accept as Solution.
Thank you very much!! Work like a charm.
The link to styles.css appears broken.
I have a similar problem, In my case file exists in the directory but the media path is not rendering on the frontend. Any suggestion would be appreciated.
Example `%7B%7BMEDIA_URL%7D%7Dstyles.css`