.htaccess文件中的问题-使用gzip deflate的RewriteCond

时间:2018-10-08 19:56:13

标签: .htaccess optimization server cpanel

将根文件夹重定向规则添加到项目中的特定文件夹时,带有gzip的压缩文件不起作用。我该如何使用这两件事?

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>


RewriteEngine on
RewriteCond %{HTTP_HOST} ^MYDOMAIN.COM$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.MYDOMAIN.COM$
RewriteCond %{REQUEST_URI} !portfoliobuild/
RewriteRule (.*) /portfoliobuild/$1 [L]

0 个答案:

没有答案