2011-03-01 132 views
0

我有一个页面index.php,这取决于提供的参数生成不同的输出。 使用mod_rewrite我有这些文件a.htm,b.htm和c.htm。 现在,我想这些特殊的4个文件(或实际的URL)进行本地缓存, 对于我试图URL重写和缓存控制apache htaccess

<FilesMatch "(a\.htm|b\.htm|c\.htm)$"> 
    FileETag None 
    Header set Cache-Control "max-age=7200, public, must-revalidate" 
</FilesMatch> 

但它不工作。 我们该如何解决这个问题?

+0

你可以显示你正在使用的mod_rewrite语句吗? – 2011-03-01 17:03:22

回答

0
RewriteEngine on 
RewriteRule index.htm index.php 
<FilesMatch "index.htm"> 
    FileETag None 
    Header set Cache-Control "max-age=7200, public, must-revalidate" 
</FilesMatch> 

这是我现在所拥有的最高峰。但从长远来看,会有很多文件和重写的网址。所以我想通过htaccess添加缓存标题。希望它是有道理的!