ExpiresDefault on dynamic url?

时间:2013-06-22 09:12:27

标签: apache .htaccess httpd.conf

我有不同类型的动态网址     /dynamic/image/day/blah/blah/blah.jpg     /dynamic/image/week/blah/blah/blah.png     /dynamic/image/month/blah/blah/blah.gif

这个网址不是实际的文件系统路径,而是由php脚本提供..

在httpd.conf中:

乳清我尝试使用以下配置:

ExpiresActive On
ExpiredDefault A0

<LocationMatch */image/day/*>
ExpiresDefault A86400
</LocationMatch>

<LocationMatch */image/week/*>
ExpiresDefault A604800
</LocationMatch>

它将最后一个&#39; A604800&#39;(星期后)到期标题应用于这两种类型的文件..意味着即使是/ day /类型的网址,最后的ExpiresDefault将覆盖所有上述ExpiresDefault。

I have also tried putting FilesMatch inside LocationMatch like this :
<LocationMatch */image/week/*>
<FilesMatch "\.(jpg|jpeg|png)">
    ExpiresDefault A604800
</FilesMatch>
</LocationMatch>

但是现在没有一个指向FilesMatch的内部正在执行意味着没有设置Expires头..

我也尝试使用Header set ,,但看起来它并没有遵循Locationmatch条件,但只是最后一个Header Set适用于所有..

这些是动态网址,而不是实际目录,所以我不能在不同的日,周等使用不同的htaccess。 任何解决方案..?

0 个答案:

没有答案