# Bildpfad (gelöst)

**URL:** https://forum.shopware.com/t/bildpfad-gelost/34712
**Category:** Allgemein
**Created:** [23. Februar 2016 um 09:46 UTC](https://forum.shopware.com/t/bildpfad-gelost/34712 "2016-02-23T09:46:28Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![SebastianS](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@SebastianS](https://forum.shopware.com/u/SebastianS)
#### Post date: [23. Februar 2016 um 09:46 UTC](https://forum.shopware.com/t/bildpfad-gelost/34712/1 "2016-02-23T09:46:28Z")

</div>

Hallo Community,

ich führe gerade eine Diskussion mit einem Diesntleister in der es um den Bilderpfad bei Shopware geht.

Bei mir, und auch auf [shopwaredemo.de](http://shopwaredemo.de) werden die Bilder über

```
http://www.shopwaredemo.de/media/image/b8/f9/55/SW10022.jpg

```

&nbsp;geladen. Versucht man das Bild über&nbsp;

```
http://www.shopwaredemo.de/media/image/SW10022.jpg

```

zu laden erhält man eine Fehlermeldung.

Der Dienstleister sagt, dass der korrekte Bildpfad&nbsp;

```
http://www.shopwaredemo.de/media/image/SW10022.jpg

```

ist, welcher nur in der Demo nicht funktioniert. Ich bin der Meinung dass sich der Bildpfad bei irgendeinem der letzten plugins geändert hat, und jetzt alle Artikelbilder in eigenen Ordnern liegen!?

Wer hat Recht? Ich habe Shopware 5.1.2 im Einsatz.

Im Voraus vielen Dank

---

<div class="post-metadata">

### Author: ![Tanny](https://avatars.discourse-cdn.com/v4/letter/t/dfb087/32.png) [@Tanny](https://forum.shopware.com/u/Tanny)
#### Post date: [23. Februar 2016 um 09:48 UTC](https://forum.shopware.com/t/bildpfad-gelost/34712/2 "2016-02-23T09:48:26Z")

</div>

Du hast recht…

---

<div class="post-metadata">

### Author: ![SebastianS](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@SebastianS](https://forum.shopware.com/u/SebastianS)
#### Post date: [23. Februar 2016 um 10:12 UTC](https://forum.shopware.com/t/bildpfad-gelost/34712/3 "2016-02-23T10:12:13Z")

</div>

Vielen dank für die schnelle Antwort.

Ich habe gerade mal etwas in den upgrade guides gelesen, und herausgefunden, dass die Bildpfad änderung wohl mit 5.1.0 Rc1 eingeführt wurde. Auf github steht in der upgrade.md allerdings auch folgendes dazu:

> - A MediaPathNormalizer removes all unrelevant parts of a string to get a coherent syntax like&nbsp;`media/image/blue_shoes_size37.jpg`

&nbsp;&nbsp;

Was soll das jetzt genau heißen? Müssten meine Bilder auch ohne die neuen Unterordner aufgerufen werden können?

---

<div class="post-metadata">

### Author: ![iLuHa](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/iluha/32/8191_2.png) [@iLuHa](https://forum.shopware.com/u/iLuHa)
#### Post date: [23. Februar 2016 um 10:24 UTC](https://forum.shopware.com/t/bildpfad-gelost/34712/4 "2016-02-23T10:24:21Z")

</div>

Es sind normalerweise nur die statisch eingebundenen Bilder noch mit dem Pfad ohne Unterordner eingebunden, da Shopware seit der Umstellung der Pfade, die Pfade natürlich auch angepasst hat.

Aufrufbar sollten die Bilder jedoch trotztdem sein, da Shopware automatisch auf den neuen Pfad mit Unterordnern weiterleitet.

Du erhälst dann ledigleich eine Meldung in deiner Shopware Log.

EDIT: Siehe auch hier:&nbsp;[http://forum.shopware.com/discussion/comment/149356/](http://forum.shopware.com/discussion/comment/149356/)

---

<div class="post-metadata">

### Author: ![SebastianS](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@SebastianS](https://forum.shopware.com/u/SebastianS)
#### Post date: [23. Februar 2016 um 10:40 UTC](https://forum.shopware.com/t/bildpfad-gelost/34712/5 "2016-02-23T10:40:18Z")

</div>

Hallo iLuHa,

bei mir leitet Shopware leider nichts um. Wenn ich die das Bild bei mir über

```
http://www.shopwaredemo.de/media/image/SW10022.jpg

```

&nbsp;

aufrufe, erhalte ich den Statuscode 404 not found. Muss man diesen redirect irgendwo aktivieren?&nbsp;

---

<div class="post-metadata">

### Author: ![iLuHa](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/iluha/32/8191_2.png) [@iLuHa](https://forum.shopware.com/u/iLuHa)
#### Post date: [23. Februar 2016 um 11:00 UTC](https://forum.shopware.com/t/bildpfad-gelost/34712/6 "2016-02-23T11:00:03Z")

</div>

Soweit ich weiß muss dies nicht erst extra aktiviert werden.

Der neue Media Service wurde, wenn ich mich nicht täusche, mit Shopware 5.1 eingeführt.  
Siehe hier:&nbsp;[Shopware 5 upgrade guide](https://developers.shopware.com/developers-guide/shopware-5-upgrade-guide-for-developers/#media-service)

Sollte also eigentlich alles ohne aktivieren oder sonst etwas auf die alten Bilder weiterleiten.  
Seit wann tritt das Problemm&nbsp;denn auf?

---

<div class="post-metadata">

### Author: ![SebastianS](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@SebastianS](https://forum.shopware.com/u/SebastianS)
#### Post date: [23. Februar 2016 um 11:09 UTC](https://forum.shopware.com/t/bildpfad-gelost/34712/7 "2016-02-23T11:09:11Z")

</div>

Seit wann dies Auftritt kann ich nicht sagen. In meinem Shop wird auch alles korrekt dargestellt. Ich habe jetzt ein Plugin im Test welches auf die Artikelbilder zugreift. Und eben dieses Plugin ruft den alten Pfad ab. Da bei mir allerdings nichts umgeleitet wird, wird natürlich kein Bild angezeigt.

Mir ist aufgefallen, dass auf [shopwaredemo.de](http://shopwaredemo.de) auch nicht vom alten auf den neuen Pfad umgeleitet wird. Ich blicke da jetzt ehrlich gesagt nicht mehr wirklich durch&nbsp;wie das korrekte Verhalten sein sollte.

---

<div class="post-metadata">

### Author: ![sonic](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sonic/32/25728_2.png) [@sonic](https://forum.shopware.com/u/sonic)
#### Post date: [23. Februar 2016 um 11:11 UTC](https://forum.shopware.com/t/bildpfad-gelost/34712/8 "2016-02-23T11:11:48Z")

</div>

Der „Fallback“ selber kommt aus der .htacces im Media-Ordner - und hat aktuell diesen Inhalt:  
Vielleicht fehlt diese htaccess evtl.?

```
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ ../shopware.php?controller=Media&action=fallback [PT,L,QSA]

```

&nbsp;

---

<div class="post-metadata">

### Author: ![SebastianS](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@SebastianS](https://forum.shopware.com/u/SebastianS)
#### Post date: [23. Februar 2016 um 11:23 UTC](https://forum.shopware.com/t/bildpfad-gelost/34712/9 "2016-02-23T11:23:01Z")

</div>

Hallo Sonic,

das hilft wahrscheinlich schonmal weiter. Die .htaccess ist vorhanden, und ebenfalls der Eintrag. Mein Shop läuft allerdings über nginx. Da wird ja die htaccess nicht berücksichtigt, oder?

---

<div class="post-metadata">

### Author: ![iLuHa](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/iluha/32/8191_2.png) [@iLuHa](https://forum.shopware.com/u/iLuHa)
#### Post date: [23. Februar 2016 um 11:55 UTC](https://forum.shopware.com/t/bildpfad-gelost/34712/10 "2016-02-23T11:55:29Z")

</div>

Richtig, nginx berücksichtigt die htaccess nicht, dazu hat er eine eigene Konfigurations Datei.

---

<div class="post-metadata">

### Author: ![SebastianS](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@SebastianS](https://forum.shopware.com/u/SebastianS)
#### Post date: [23. Februar 2016 um 11:56 UTC](https://forum.shopware.com/t/bildpfad-gelost/34712/11 "2016-02-23T11:56:58Z")

</div>

Ok, dann werde ich mal mit meinem Provider sprechen ob man das irgendwie lösen kann.

---

<div class="post-metadata">

### Author: ![sonic](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sonic/32/25728_2.png) [@sonic](https://forum.shopware.com/u/sonic)
#### Post date: [23. Februar 2016 um 12:05 UTC](https://forum.shopware.com/t/bildpfad-gelost/34712/12 "2016-02-23T12:05:54Z")

</div>

Vielleicht hilft das ja weiter

> <https://github.com/bcremer/shopware-with-nginx/blob/master/global/shopware.conf#L48>

---

<div class="post-metadata">

### Author: ![SebastianS](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@SebastianS](https://forum.shopware.com/u/SebastianS)
#### Post date: [23. Februar 2016 um 14:42 UTC](https://forum.shopware.com/t/bildpfad-gelost/34712/13 "2016-02-23T14:42:40Z")

</div>

Vielen Dank für den Link. Funktioniert nun alles wie gewünscht.
