国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

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

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>

曾經(jīng)蠟筆沒有小新

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