<IfModule mod_headers.c>
    Header append Vary Accept env=REQUEST_image
</IfModule>

<IfModule mod_mime.c>
    AddType image/webp .webp
    AddType application/font-woff2 .woff2
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On

#如果webp存在
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{DOCUMENT_ROOT}/cache/webp/$1.webp -f
RewriteRule (.+)\.(jpe?g|png)$ /cache/webp/$1.webp [L,T=image/webp,E=REQUEST_image]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(jpg|jpeg|png|gif|ico|swf|bmp)$ - [nocase,redirect=404,last]
                    
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) /readyscript/capps/pc2-p/index.php [L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{HTTP_USER_AGENT} !^.*Google.*$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} !^.*yahoo.*$ [NC,OR]
RewriteRule ^(.+)\.(pdf|xls|xlsx|doc|docx|zip|rar)$ /readyscript/capps/pc2-p/index.php [L,NC]
</IfModule>

ExpiresActive On
# Fonts
ExpiresByType font/ttf "access plus 1 year"
ExpiresByType font/otf "access plus 1 year"
ExpiresByType font/woff "access plus 1 year"
ExpiresByType font/woff2 "access plus 1 year"
ExpiresByType application/font-woff "access plus 1 year"
ExpiresByType font/woff2?v=4.7.0 "access plus 1 year"

#IMG
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"                
