Magento – 404 not found magento 2 static and media files not loading

404base-urlmagento2

**resources not loading after changing base url**
resources not loading after changing base url. i have tried changing base_url for media files.

Best Answer

Magento 2.2.2

Apache/2.4.6 (CentOS)

I tried:

rm -rf pub/static/* generated/* var/page_cache/* var/cache/* var/view_preprocessed/*
chown -R apache:apache .*
find . -type d -exec chmod 0770 {} \;
find . -type f -exec chmod 0660 {} \;
php bin/magento cache:clean
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f

Found out the pub/static/.htaccess file was missing. Added it back in and static content showed up.

Related Topic