7 Answers
Please check mod_rewrite enabled in your server and also check the directory symlinks like this in your server.
Open /etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
-
-
your using windows right..find the keyword like FollowSymlinks and give granted access. Commented Aug 9, 2019 at 11:23
-
Yes, it is windows 10. I put like this <Directory /> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> but not working. It still shows the same thing. Commented Aug 9, 2019 at 11:29
-
-
Yes, I enabled it already. Actually, my other Magento project working well. But this one I copied from a friend not loading CSS, js. Commented Aug 9, 2019 at 11:37
please check it pub/static/ inside htaccess exits or not same path pub/media/ inside check it after all command apply it
I solved this problem by running:
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
This could be an issue with symlinks. I see that deploy.php worked for you, but you may also try deleting the resources
from pub/static
and seeing if the instructions from https://magento.stackexchange.com/a/64808/594 work for you. If so, then it may save you some time during development as it should be faster than running deploy.php.
I hope this will help
-
I followed those steps perfectly but it is not working. And admin page showing page not found like that. Commented Aug 9, 2019 at 11:38
If you imported database from the server where secure connection (https) is enabled, you need to disable it in local copy of the database (because you probably doesn't have secure connection on a localhost):
bin/magento setup:store-config:set --use-secure=0 --use-secure-admin=0
bin/magento cache:flush
Another thing to check is any speed optimizer modules. I didn't notice my client had one called MagePow Speedoptimizer and it sneakily was moving the require.js from loading in the head section to the body which doesn't work well at all, so I disabled it.
There are other speedoptimizer modules too for Magento 2 that can cause this.
It could be the many reason for the same error.
In my case my base url was set as http but it will redirects to https protocol.
I have set https protocol in base url and it works.