2016-09-22 2 views
0

아파치 용 mod_deflate를 활성화했지만 svg 파일에서 작동하지 않습니다 ... 어떻게 활성화 할 수 있습니까? 또는 적어도 prestashop에서 svgz 확장을 허용하여 직접 압축을 업로드 할 수 있습니다. 고마워요mod_deflate를 사용하여 svg 파일을 축약합니다.

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again 
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution 
# http://www.prestashop.com - http://www.prestashop.com/forums 

<IfModule mod_rewrite.c> 
<IfModule mod_env.c> 
SetEnv HTTP_MOD_REWRITE On 
</IfModule> 

RewriteEngine on 


#Domain: localhost 
RewriteRule . - [E=REWRITEBASE:/prestawebserver/] 
RewriteRule ^api$ api/ [L] 

RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php url=$1 [QSA,L] 

# Images 
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L] 
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L] 
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L] 
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L] 
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L] 
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L] 
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L] 
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L] 
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L] 
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L] 
# AlphaImageLoader for IE and fancybox 
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L] 

# Dispatcher 
RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L] 
</IfModule> 

AddType application/vnd.ms-fontobject .eot 
AddType font/ttf .ttf 
AddType font/otf .otf 
AddType application/x-font-woff .woff 
<IfModule mod_headers.c> 
    <FilesMatch "\.(ttf|ttc|otf|eot|woff|svg)$"> 
     Header add Access-Control-Allow-Origin "*" 
    </FilesMatch> 
</IfModule> 

<IfModule mod_expires.c> 
    ExpiresActive On 
    ExpiresByType image/gif "access plus 1 month" 
    ExpiresByType image/jpeg "access plus 1 month" 
    ExpiresByType image/png "access plus 1 month" 
    ExpiresByType text/css "access plus 1 week" 
    ExpiresByType text/javascript "access plus 1 week" 
    ExpiresByType application/javascript "access plus 1 week" 
    ExpiresByType application/x-javascript "access plus 1 week" 
    ExpiresByType image/x-icon "access plus 1 year" 
    ExpiresByType image/svg+xml "access plus 1 year" 
    ExpiresByType image/vnd.microsoft.icon "access plus 1 year" 
    ExpiresByType application/font-woff "access plus 1 year" 
    ExpiresByType application/x-font-woff "access plus 1 year" 
    ExpiresByType application/vnd.ms-fontobject "access plus 1 year" 
    ExpiresByType font/opentype "access plus 1 year" 
    ExpiresByType font/ttf "access plus 1 year" 
    ExpiresByType font/otf "access plus 1 year" 
    ExpiresByType application/x-font-ttf "access plus 1 year" 
    ExpiresByType application/x-font-otf "access plus 1 year" 
</IfModule> 

<IfModule mod_headers.c> 
    Header unset Etag 
</IfModule> 
FileETag none 
<IfModule mod_deflate.c> 
    AddOutputFilterByType DEFLATE text/html 
    AddOutputFilterByType DEFLATE text/css 
    AddOutputFilterByType DEFLATE text/javascript 
    AddOutputFilterByType DEFLATE text/xml 
    AddOutputFilterByType DEFLATE text/plain 
    AddOutputFilterByType DEFLATE image/x-icon 
    AddOutputFilterByType DEFLATE image/svg+xml 
    AddOutputFilterByType DEFLATE application/rss+xml 
    AddOutputFilterByType DEFLATE application/javascript 
    AddOutputFilterByType DEFLATE application/x-javascript 
    AddOutputFilterByType DEFLATE application/xml 
    AddOutputFilterByType DEFLATE application/xhtml+xml 
    AddOutputFilterByType DEFLATE application/x-font 
    AddOutputFilterByType DEFLATE application/x-font-truetype 
    AddOutputFilterByType DEFLATE application/x-font-ttf 
    AddOutputFilterByType DEFLATE application/x-font-otf 
    AddOutputFilterByType DEFLATE application/x-font-opentype 
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject 
    AddOutputFilterByType DEFLATE font/ttf 
    AddOutputFilterByType DEFLATE font/otf 
    AddOutputFilterByType DEFLATE font/opentype 

# For Olders Browsers Which Can't Handle Compression 
    BrowserMatch ^Mozilla/4 gzip-only-text/html 
    BrowserMatch ^Mozilla/4\.0[678] no-gzip 
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html 
</IfModule> 
#If rewrite mod isn't enabled 
ErrorDocument 404 /prestawebserver/index.php?controller=404 

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again 
+0

어떻게 작동하지 않을 수 있습니까? 시험을 보셨나요? '.htaccess'의 규칙은 ok입니다 – sarcom

+0

@ sarcom yea google pagespeed 통찰력은 모든 svg를 나열했습니다 ... – Marwane

+0

음 ... 아마 아파치 구성을 확인해야합니다 :) 나는 더 이상 도움이되지 못합니다. ( – sarcom

답변

관련 문제