# WebP via htaccess

**URL:** <https://forum.shopware.com/t/webp-via-htaccess/47977>\
**Category:** Programmierung\
**Created:** [1. September 2017 um 06:09 UTC](https://forum.shopware.com/t/webp-via-htaccess/47977 "2017-09-01T06:09:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![runde8](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/runde8/32/13502_2.png) [@runde8](https://forum.shopware.com/u/runde8)\
**Post date:** [1. September 2017 um 06:09 UTC](https://forum.shopware.com/t/webp-via-htaccess/47977/1 "2017-09-01T06:09:28Z")

</div>

Hey zusammen, ich bin heute über Umwege auf den Einsatz von WebP und der entsprechenden Einsparung von bis zu 80% gestoßen.

Hat das schon jemand so im Einsatz?

Hier gibt es Infos auf Github dazu:&nbsp;[GitHub - vincentorback/WebP-images-with-htaccess: Serving WebP images with htaccess](https://github.com/vincentorback/WebP-images-with-htaccess)

Hier mal die .htaccess&nbsp;

```
  RewriteEngine On
  # check if browser accepts webp
  RewriteCond %{HTTP_ACCEPT} image/webp

  # check if file is jpg or png
  RewriteCond %{REQUEST_FILENAME} (.*).(jpe?g|png)$

  # check if corresponding webp file exists image.png -> image.webp
  RewriteCond %1.webp -f

  # serve up webp instead
  RewriteRule (.+).(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]

  Header append Vary Accept env=REDIRECT_accept

AddType image/webp .webp

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![arnebecker](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@arnebecker](https://forum.shopware.com/u/arnebecker)\
**Post date:** [1. September 2017 um 09:49 UTC](https://forum.shopware.com/t/webp-via-htaccess/47977/2 "2017-09-01T09:49:35Z")

</div>

Was genau ist denn deine Frage?

---

<div class="post-metadata">

**Author:** ![shyim](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/shyim/32/7681_2.png) [@shyim](https://forum.shopware.com/u/shyim)\
**Post date:** [7. September 2017 um 18:38 UTC](https://forum.shopware.com/t/webp-via-htaccess/47977/3 "2017-09-07T18:38:10Z")

</div>

Ich fand das ganze ganz Interesant und hab ein Plugin umgesetzt welches zusätzliche Thumbnails erstellt und diese via source Tag einbindet, damit Browser die es unterstützen es automatisch nutzen.

Das ganze natürlich unter eigener Gefahr und sollte erst auf einer Testumgebung getestet werden :)&nbsp;[https://github.com/shyim/ShyimWebP](https://github.com/shyim/ShyimWebP)

PS: PHP GD muss WebP Support haben

---

<div class="post-metadata">

**Author:** ![runde8](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/runde8/32/13502_2.png) [@runde8](https://forum.shopware.com/u/runde8)\
**Post date:** [8. September 2017 um 05:17 UTC](https://forum.shopware.com/t/webp-via-htaccess/47977/4 "2017-09-08T05:17:06Z")

</div>

> [@Shyim schrieb:](https://forum.shopware.com/profile/20792/Shyim "Shyim")
> 
> Ich fand das ganze ganz Interesant und hab ein Plugin umgesetzt welches zusätzliche Thumbnails erstellt und diese via source Tag einbindet, damit Browser die es unterstützen es automatisch nutzen.
> 
> Das ganze natürlich unter eigener Gefahr und sollte erst auf einer Testumgebung getestet werden ![:)](https://dub1.discourse-cdn.com/flex013/resources/emoji/smile.png ":)")&nbsp;[https://github.com/shyim/ShyimWebP](https://github.com/shyim/ShyimWebP)
> 
> PS: PHP GD muss WebP Support haben

Interessanter Ansatz! Werd ich mir heute mittag definitiv mal ansehen 🙂

---

<div class="post-metadata">

**Author:** ![soty20](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@soty20](https://forum.shopware.com/u/soty20)\
**Post date:** [17. Mai 2020 um 03:14 UTC](https://forum.shopware.com/t/webp-via-htaccess/47977/5 "2020-05-17T03:14:21Z")

</div>

See u moar this -&nbsp;[https://storedigital.ru/2020/05/14/konverter-webp-kak-ispolzovat-etot-format-na-svoyom-sajte/](https://storedigital.ru/2020/05/14/konverter-webp-kak-ispolzovat-etot-format-na-svoyom-sajte/) . for nginx server need a little setup
