Magento 2.0 is released, however there may be various issues that a Developer might go through.One of the prime concern would be: Broken Links for Static files like js, css & images etc.
links will not work in following cases:
- Installation of Magento 2.0 in Windows
- Moving the folders to any other location
- Migrating your current magento 2.0 to another server or go live
So if you face such kind of issues, and your admin and front end link’s are not functioning accordingly,
and all static file links are not working because of symlinks created by Magento for Static content.
please follow the below steps to fix the same:
- Remove all files and folders , except .htaccess file from
- Open /magento2path/app/etc/di.xml
- if you want to remove symlinks then edit app/etc/di.xml file. or if you just want to fix symlinks than do not edit app/etc/di.xml
- find following code
PHP123456789101112131415<virtualType name="developerMaterialization" type="MagentoFrameworkAppViewAssetMaterializationStrategyFactory"><arguments><argument name="strategiesList" xsi:type="array"><item name="view_preprocessed" xsi:type="object"><strong>MagentoFrameworkAppViewAssetMaterializationStrategySymlink</strong></item><item name="default" xsi:type="object">MagentoFrameworkAppViewAssetMaterializationStrategyCopy</item></argument></arguments></virtualType><pre></li><li>replace to “MagentoFrameworkAppViewAssetMaterializationStrategyCopy”</li></ul></li><li>remove all cache & setup cache files<ul><li><pre>rm -rf var/cache/ var/di/ var/generation/ var/page_cache/
- Deploy Static Content again
NOTE: Make sure you have backup for pub/static folder