# All images path are wrong after switching server

**URL:** <https://forum.shopware.com/t/all-images-path-are-wrong-after-switching-server/87779>\
**Category:** General Questions (EN)\
**Created:** [19. Mai 2021 um 17:43 UTC](https://forum.shopware.com/t/all-images-path-are-wrong-after-switching-server/87779 "2021-05-19T17:43:48Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rann](https://avatars.discourse-cdn.com/v4/letter/r/7993a0/32.png) [@Rann](https://forum.shopware.com/u/Rann)\
**Post date:** [19. Mai 2021 um 17:43 UTC](https://forum.shopware.com/t/all-images-path-are-wrong-after-switching-server/87779/1 "2021-05-19T17:43:48Z")

</div>

Hi all,

I’ve recently moved my (work in progress) website, from my local enviroment to an online enviroment. And currently all images are missing due to having new image paths.

For example: Locally the logo URL is:  
[http://localhost/media/84/17/65/1615642104/logo.svg](http://localhost/media/84/17/65/1615642104/logo.svg)

Online the image url is:  
[http://domeinexample.nl/media/72/ec/8f/1615642104/logo.svg](http://domeinexample.nl/media/72/ec/8f/1615642104/logo.svg)

I’ve tried it twice now, but the result is the same ☹

Any suggestions?

---

<div class="post-metadata">

**Author:** ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)\
**Post date:** [19. Mai 2021 um 18:51 UTC](https://forum.shopware.com/t/all-images-path-are-wrong-after-switching-server/87779/2 "2021-05-19T18:51:07Z")

</div>

Which media strategy do you use in the .env file? Is it the same on both servers?

---

<div class="post-metadata">

**Author:** ![Rann](https://avatars.discourse-cdn.com/v4/letter/r/7993a0/32.png) [@Rann](https://forum.shopware.com/u/Rann)\
**Post date:** [19. Mai 2021 um 20:01 UTC](https://forum.shopware.com/t/all-images-path-are-wrong-after-switching-server/87779/3 "2021-05-19T20:01:22Z")

</div>

There’s no real difference between the two, atleast nothing media related or what should cause this as far as I know…

**Local:**  
APP\_ENV=dev  
APP\_SECRET=1  
INSTANCE\_ID=1  
DATABASE\_URL=mysql://xxx:xxx@localhost:3306/shopware  
APP\_URL=http://localhost  
MAILER\_URL=smtp://localhost:1025  
COMPOSER\_HOME=/var/www/html/var/cache/composer  
SHOPWARE\_ES\_ENABLED=0

**Online:**  
APP\_ENV=prod  
APP\_SECRET=xxx  
APP\_URL=http://xxx.domain.com  
MAILER\_URL=null://localhost  
DATABASE\_URL=mysql://xxxx@localhost:3306/shopware  
COMPOSER\_HOME=/data/web/shopware/var/cache/composer  
INSTANCE\_ID=xxx  
BLUE\_GREEN\_DEPLOYMENT=1  
SHOPWARE\_HTTP\_CACHE\_ENABLED=1  
SHOPWARE\_HTTP\_DEFAULT\_TTL=7200  
SHOPWARE\_ES\_HOSTS=""  
SHOPWARE\_ES\_ENABLED=„0“  
SHOPWARE\_ES\_INDEXING\_ENABLED=„0“  
SHOPWARE\_ES\_INDEX\_PREFIX=„sw“  
SHOPWARE\_CDN\_STRATEGY\_DEFAULT=„id“

---

<div class="post-metadata">

**Author:** ![Shrek](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Shrek](https://forum.shopware.com/u/Shrek)\
**Post date:** [20. Mai 2021 um 22:20 UTC](https://forum.shopware.com/t/all-images-path-are-wrong-after-switching-server/87779/4 "2021-05-20T22:20:46Z")

</div>

> [@Rann](#):
>
> SHOPWARE\_CDN\_STRATEGY\_DEFAULT=„id“

SHOPWARE\_CDN\_STRATEGY\_DEFAULT=„id“

---

<div class="post-metadata">

**Author:** ![Rann](https://avatars.discourse-cdn.com/v4/letter/r/7993a0/32.png) [@Rann](https://forum.shopware.com/u/Rann)\
**Post date:** [23. Mai 2021 um 12:41 UTC](https://forum.shopware.com/t/all-images-path-are-wrong-after-switching-server/87779/5 "2021-05-23T12:41:50Z")

</div>

Hi,

thanks for that reply, I’ve removed the line, but nothing changed after clearing the cache, should I do something else ?

---

<div class="post-metadata">

**Author:** ![Shrek](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Shrek](https://forum.shopware.com/u/Shrek)\
**Post date:** [24. Mai 2021 um 22:49 UTC](https://forum.shopware.com/t/all-images-path-are-wrong-after-switching-server/87779/6 "2021-05-24T22:49:03Z")

</div>

> [@Shrek](#):
>
> SHOPWARE\_CDN\_STRATEGY\_DEFAULT=„id“

instead of deleting try. This sets different strategy for creating pic preferences  
SHOPWARE\_CDN\_STRATEGY\_DEFAULT=physical\_filename  
or  
SHOPWARE\_CDN\_STRATEGY\_DEFAULT=filename

---

<div class="post-metadata">

**Author:** ![Rann](https://avatars.discourse-cdn.com/v4/letter/r/7993a0/32.png) [@Rann](https://forum.shopware.com/u/Rann)\
**Post date:** [25. Mai 2021 um 19:21 UTC](https://forum.shopware.com/t/all-images-path-are-wrong-after-switching-server/87779/7 "2021-05-25T19:21:33Z")

</div>

Do you mean on my development enviroment? Or on the production?

I haven’t set anything currently on development and production (removed the line there),

do I need to ‚do‘ anything to re-create the imagepaths after changing this setting? (development currently has a similar syntax, but with different folders/numbers in it)

---

<div class="post-metadata">

**Author:** ![Rann](https://avatars.discourse-cdn.com/v4/letter/r/7993a0/32.png) [@Rann](https://forum.shopware.com/u/Rann)\
**Post date:** [29. Mai 2021 um 10:36 UTC](https://forum.shopware.com/t/all-images-path-are-wrong-after-switching-server/87779/8 "2021-05-29T10:36:34Z")

</div>

Ah that fixed it!

Had to restart the enviroment for the changes to have effect. Thanks!

---

<div class="post-metadata">

**Author:** ![edgezop](https://avatars.discourse-cdn.com/v4/letter/e/ec9cab/32.png) [@edgezop](https://forum.shopware.com/u/edgezop)\
**Post date:** [29. Juli 2021 um 11:18 UTC](https://forum.shopware.com/t/all-images-path-are-wrong-after-switching-server/87779/9 "2021-07-29T11:18:59Z")

</div>

actually i was thinking about the same.[.](https://tomzpot.com/) [.](https://mdro.fun/mobdro/)

---

<div class="post-metadata">

**Author:** ![padaja](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@padaja](https://forum.shopware.com/u/padaja)\
**Post date:** [20. April 2022 um 12:55 UTC](https://forum.shopware.com/t/all-images-path-are-wrong-after-switching-server/87779/11 "2022-04-20T12:55:36Z")

</div>

I have the same problem right now. How can i fix this issue, when i never changed the .env file?
