This commit is contained in:
merdan 2021-04-15 15:38:38 +05:00
parent 00a65f5e68
commit 1ad903e92c
1 changed files with 25 additions and 25 deletions

View File

@ -1,30 +1,30 @@
## START OFFLINE.ResponsiveImages - webp-rewrite
# DO NOT REMOVE THESE LINES
<IfModule mod_setenvif.c>
# Vary: Accept for all the requests to jpeg and png
SetEnvIf Request_URI "\.(jpe?g|png)$" REQUEST_image
</IfModule>
<ifModule mod_rewrite.c>
RewriteEngine On
# If the Browser supports WebP images, and the .webp file exists, use it.
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{REQUEST_URI} ^/?storage/.*\.(jpe?g|png)
RewriteCond %{REQUEST_FILENAME}.webp -f
RewriteRule ^/?(.*)$ $1.webp [NC,T=image/webp,END]
# If the Browser supports WebP images, and the .webp file does not exist, generate it.
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{REQUEST_URI} ^/?storage/.*\.(jpe?g|png)
RewriteCond %{REQUEST_FILENAME}\.webp !-f
RewriteRule ^/?(.*)$ plugins/offline/responsiveimages/webp.php?path=$1 [NC,END]
</ifModule>
<IfModule mod_headers.c>
Header append Vary Accept env=REQUEST_image
</IfModule>
<IfModule mod_mime.c>
AddType image/webp .webp
</IfModule>
#<IfModule mod_setenvif.c>
# # Vary: Accept for all the requests to jpeg and png
# SetEnvIf Request_URI "\.(jpe?g|png)$" REQUEST_image
#</IfModule>
#<ifModule mod_rewrite.c>
# RewriteEngine On
#
# # If the Browser supports WebP images, and the .webp file exists, use it.
# RewriteCond %{HTTP_ACCEPT} image/webp
# RewriteCond %{REQUEST_URI} ^/?storage/.*\.(jpe?g|png)
# RewriteCond %{REQUEST_FILENAME}.webp -f
# RewriteRule ^/?(.*)$ $1.webp [NC,T=image/webp,END]
#
# # If the Browser supports WebP images, and the .webp file does not exist, generate it.
# RewriteCond %{HTTP_ACCEPT} image/webp
# RewriteCond %{REQUEST_URI} ^/?storage/.*\.(jpe?g|png)
# RewriteCond %{REQUEST_FILENAME}\.webp !-f
# RewriteRule ^/?(.*)$ plugins/offline/responsiveimages/webp.php?path=$1 [NC,END]
#</ifModule>
#<IfModule mod_headers.c>
# Header append Vary Accept env=REQUEST_image
#</IfModule>
#<IfModule mod_mime.c>
# AddType image/webp .webp
#</IfModule>
## END OFFLINE.ResponsiveImages - webp-rewrite