Magento 2 static and media files not loading -404 not found

Samsul Hoque
1
I have installed Magento 2 but static and media files not loadingshowing 404 not found.


The problem was apache.

Solution:

Step-1: Needed to set AllowOverride All in the virtualhost :


 sudo nano /etc/apache2/apache2.conf

edit:

<Directory /var/www/>
     Options Indexes FollowSymLinks
     AllowOverride None
     Require all granted
</Directory>
to
<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>
Step-2:Enable mod_rewrite for Apache 
sudo a2enmod rewrite
sudo systemctl restart apache2

Post a Comment

1Comments
  1. Thanks for informative post. I am pleased sure this post has helped me save many hours of browsing other similar posts just to find what I was looking for. Just I want to say: Thank you! hosting wordpress installation,
    domain and hosting

    ReplyDelete
Post a Comment