cancel
Showing results for 
Search instead for 
Did you mean: 

404 error for scripts and CSS

404 error for scripts and CSS

Hello everyone,

 

When not in the production mode, Magento 2 will try to create symlinks for some static resources. You can change that behavior by doing the following.

  • Open up app/etc/di.xml and find the virtualType name=”developerMaterialization”. In that section, you’ll find an item name=”view_preprocessed” that needs to be modified or deleted. You can modify it by changing the contents from Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink to Magento\Framework\App\View\Asset\MaterializationStrategy\Copy
  • Delete the files under pub/static to get rid of any existing symlinks. You may want to be careful not to delete the .htaccess

If you find my answer useful, Please click Kudos & Accept as Solution.

Magento Developer
Ankita Biswas