[Linux笔记] Apache 常用优化 .htaccess 规则

2 Comments

DEFLATE压缩html|css|xml|js等网页文件:

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

缓存.flv|gif|jpg|jpeg|png|ico|swf|js|css|pdf等文件


Header set Cache-Control "max-age=2592000"

禁止缓存pl|php|cgi|spl|scgi|fcgi等动态网页文件


Header unset Cache-Control

禁止禁止访问.htaccess


order allow,deny
deny from all

2 Thoughts on “[Linux笔记] Apache 常用优化 .htaccess 规则

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注