magento 2.x 中css,字体,js等文件的404问题(图片图标字体css缺失)

两个可能原因:
1、权限:
$ rm -rf pub/static/*
$ php bin/magento setup:static-content:deploy

2、When Magento 2 is not in production mode, it will try to create symlinks for some static resources on local server. We have to change that behavior of Magento 2 by going to edit ROOT > app > etc > di.xml file. Open up di.xml in your favorite code editor, find the virtualType name=”developerMaterialization” section. In that section below, you will find an item which needs to be modified. You can modify it by changing the following content:

MagentoFrameworkAppViewAssetMaterializationStrategySymlink
To:

MagentoFrameworkAppViewAssetMaterializationStrategyCopy
Now last step, also delete old files generated in ROOT > pub > static > DELETE ALL EXCEPT .HTACCESS

Clear / Flush Magento cache by typing “php bin/magento cache:flush” in CMD.

And finally, to Reindex Magento Static Blocks type “php bin/magento indexer:reindex”.

You are done with successful installation of Magento 2.

相关推荐

magento backend dashboard can’t log in – session error

可能很多朋友有同样的经历,magento在服务器中配置域名是可以正常的访问了,但是在本地配置后却无法登录后台,账号密码登录的时候发现出现空白,无法跳转到后台,本文章向大家介绍两种解决本地magento后台无法登录的方法,需要的朋友可以参考下

暂无评论

发表评论

微信扫一扫,分享到朋友圈

magento 2.x 中css,字体,js等文件的404问题(图片图标字体css缺失)