apache配置
1. 压缩
备注:ie6下面js压缩,有时候会无法执行
SetOutputFilter DEFLATE
<Location />
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch '\bMSIE 6' gzip-only-text/html
</Location>
2. 防止盗链,csrf攻击
SetEnvIfNoCase Referer "mail\.abc\.com" local_ref=1
SetEnvIfNoCase Referer ".*\.mail\.abc\.com" local_ref=1
SetEnvIfNoCase Request_URI "(login\.htm)$" local_ref=1
SetEnvIfNoCase Request_URI "^$" local_ref=1
<filesmatch "\.htm$">
Order Allow,Deny
Allow from env=local_ref
</filesmatch>
1. 压缩
备注:ie6下面js压缩,有时候会无法执行
SetOutputFilter DEFLATE
<Location />
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch '\bMSIE 6' gzip-only-text/html
</Location>
2. 防止盗链,csrf攻击
SetEnvIfNoCase Referer "mail\.abc\.com" local_ref=1
SetEnvIfNoCase Referer ".*\.mail\.abc\.com" local_ref=1
SetEnvIfNoCase Request_URI "(login\.htm)$" local_ref=1
SetEnvIfNoCase Request_URI "^$" local_ref=1
<filesmatch "\.htm$">
Order Allow,Deny
Allow from env=local_ref
</filesmatch>