<Files *> Options -Indexes </Files> <IfModule mod_headers.c> <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"> Header set Cache-Control "max-age=2592000, public" </FilesMatch> <FilesMatch "\.(xml|txt)$"> Header set Cache-Control "max-age=604800, public" </FilesMatch> <FilesMatch "\.(html|htm|php|shtml)$"> Header set Cache-Control "max-age=86400" </FilesMatch> </IfModule> <IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ # RewriteCond %{REQUEST_URI} !\.html$ RewriteRule ^(.*)$ /$1/ [L,R=301] #RewriteCond %{HTTP_HOST} !^(m.zbphp.com|localhost|ptwww|192.168.) [NC] #RewriteRule ^(.*)$ http://m.zbphp.com/$1 [L,R=301] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] </IfModule>
ThinkPHP 3.2 Apache .htaccess 开启缓存max-age(2014-11-7修正版)
原文地址:http://blog.csdn.net/default7/article/details/40888491