亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

php - How to properly save the image src in product details?
給我你的懷抱
給我你的懷抱 2017-05-16 12:02:02
0
4
670

Because the previous e-commerce BBC of Shangpai was not suitable, we rewrote a set of e-commerce ourselves and needed to migrate the original data to the new system. We encountered a problem during the migration. The product details (html text) The image address src was hard-coded before. Considering that the image should be placed on the cdn later, the src should also change with the current cdn. How to save the image src properly?

給我你的懷抱
給我你的懷抱

reply all(4)
漂亮男人

Then the relative path must be saved
cdnHost + src
domain + src
Even if the image is placed on the cloud, disaster recovery must be considered. If the cloud is down, normal access can still be achieved by changing the prefix of the configuration items.

滿天的星座

@Lowky is right. Generally, pictures only save relative paths to facilitate migration. The configuration file only needs to specify the domain name, such as
HOST=//sf.gg# // Compatible with http and https

<img src={{HOST}}/img/xxxx.jpg>

曾經蠟筆沒有小新

Do not retain the domain name, only the path behind the domain name, so that you can migrate to other domain names or clouds and modify it directly in the code. It is more convenient

伊謝爾倫

That’s not how it is

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template