我们需要使用.htaccess规则或nginx conf为某些图像设置重写规则
请求路径:
响应路径:
https://www.example.com/pub/media/catalog/product/cache/543x403/n/u/number1.png
请求路径:
响应路径:
https://www.example.com/pub/media/catalog/product/cache/543x403/l/e/legal_slide01.jpg
这里l/e/
目录是根据图像名称的前两个字符设置的:legal_slide01.jpg
谢谢
尝试:
rewrite ^/(media/catalog/product/cache)/\d+/thumbnail/(\d+x\d+)/[a-z0-9]+/(\S+) /pub/$1/$2/$3;