diff --git a/README.md b/README.md index 967ee3e..6c55abc 100644 --- a/README.md +++ b/README.md @@ -425,3 +425,16 @@ AddHandler application/x-httpd-php55 .php # Alternatively, you can use AddType AddType application/x-httpd-php55 .php ``` + +### Serve WebP images +If WebP images are supported and an image with a .webp extension is located as the same place as the jpg/png image that is going to be served, then the WebP image is served instead. + +``` apacheconf + + RewriteEngine On + RewriteCond %{HTTP_ACCEPT} image/webp + RewriteCond %{DOCUMENT_ROOT}/$1.webp -f + RewriteRule (.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1] + +``` +[Source](https://github.com/vincentorback/WebP-images-with-htaccess)