Magento 2 404 error for scripts and css

 Magento 2 404 error for scripts and css


1)  Please check mistakenly not deleted .htaccess file at pub/static path.

2) When Magento is not running on production mode , it will create symlinks for some static resource.

So what to do is delete pub/static/frontend and pub/static/adminhtml 

Alert : Do not delete .htaccess under pub/static/ folder. 

3) Changing the behavior.

Open up app/etc/di.xml and find the virtualType name="developerMaterialization" section. In that section one may find code 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

This should  have solve your problem with the symlink creation.

If like efforts, Please share, comment and subscribe for future posts and inspire more.


Comments

Popular posts from this blog

Hosting and Goodies

Magento 2 Import Scripts

How to add product attribute value in minicart magento 2