Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webp image is created but not served #5

Open
nafribs opened this issue Feb 29, 2024 · 0 comments
Open

webp image is created but not served #5

nafribs opened this issue Feb 29, 2024 · 0 comments

Comments

@nafribs
Copy link

nafribs commented Feb 29, 2024

I installed the module and checked the image is being created.

image

But no webp image is being served.

Below is what was added to htaccess by the module.

~~ mdn_webp_start

RewriteEngine On

Check if browser supports WebP images

RewriteCond %{HTTP_ACCEPT} image/webp

Check if WebP replacement image exists

RewriteCond %{DOCUMENT_ROOT}/$1.webp -f

Serve WebP image instead

RewriteRule (.+).(jpe?g|png|gif)$ $1.webp [T=image/webp,E=REQUEST_image]

Vary: Accept for all the requests to jpeg, png and gif

Header append Vary Accept env=REQUEST_image

AddType image/webp .webp # ~~ mdn_webp_end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant