apache_conf htaccess中的gzip压缩

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf htaccess中的gzip压缩相关的知识,希望对你有一定的参考价值。


# AddEncoding allows you to have certain browsers uncompress information on the fly.
AddEncoding gzip .gz

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} (.*)\.js$
RewriteCond %{REQUEST_URI} !\.min\.js$
RewriteRule .* - [E=MINFILE:%1.min.js]

RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond "%{DOCUMENT_ROOT}%{ENV:MINFILE}.gz" -f
RewriteRule .* - [E=MINFILE_ENC:.gz]

RewriteCond "%{DOCUMENT_ROOT}%{ENV:MINFILE}%{ENV:MINFILE_ENC}" -f
RewriteRule . %{ENV:MINFILE}%{ENV:MINFILE_ENC} [L,QSA]

# Serve correct content types, and prevent mod_deflate double gzip.
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]

以上是关于apache_conf htaccess中的gzip压缩的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf htaccess - 删除网址中的.php

apache_conf 阻止Apache .htaccess中的xmlrpc.php

apache_conf 阻止HTACCESS中的GIT文件夹和文件

apache_conf 忽略htaccess重定向中的本地开发域

apache_conf 通过htaccess将http重定向到apache中的https

apache_conf 将其放在Wordpress uploads文件夹中的.htaccess中。它将检查您现有网站上的上传,如果找不到