禁用url自带版本号

3.04K 浏览开发笔记

禁用url自带版本号

静态文件的url带版本号时,会导致404错误。

HTTP://域] /pub/static/version1474443317/frontend/Magento/luma/en_US/mage/calendar.css

解决这个问题的两种方法:

1.在magento admin中登录并更改以下设置

Stores> Configuration> Advanced> Developer> Sign Static Files(dev_static_sign) - No


2.将`dev/static/sign`改为0

select * from core_config_data where parth like '%dev/static/sign%' limit 1; 
update core_config_data set value = 0 where path ='dev/static/sign';

如果记录不存在,则执行以下查询

insert core_config_data (config_id, scope, scope_id, path, value) values (null, 'default', 0, 'dev/static/sign', 0);

最后于 2018-6-25 被admin编辑 ,原因:
0