设置expires特定URI的标头?

Yan*_*hen 5 apache configuration

我正在尝试为特定的URI设置expire头但由于某种原因它无法正常工作,到目前为止我在httpd.conf文件中所做的是以下内容:

<LocationMatch "/mysite/contentservices/weather/get.json">
  ExpiresDefault A86400
</LocationMatch>

<LocationMatch "/mysite/*">
  Options FollowSymLinks MultiViews
  AllowOverride All
  Order allow,deny
  Allow from all
  ExpiresByType text/css "access plus 1 day"
  ExpiresByType text/javascript "access plus 1 day"
  ExpiresByType image/gif "access plus 1 week"
  ExpiresByType image/jpg "access plus 1 week"
  ExpiresByType image/png "access plus 1 week"
  ExpiresByType application/x-shockwave-flash "access plus 1 week"
</LocationMatch>
Run Code Online (Sandbox Code Playgroud)

这根本不适合我.我没有为我指定的内容提供过期日期标题.我还不明白当你有两个LocationMatch重叠的指令时,究竟会发生什么?第一个指令优先?

Mr.*_*ald 2

我不确定,但文档没有提到 LocationMatch 作为可能的上下文。

“上下文:服务器配置、虚拟主机、目录、.htaccess”

http://httpd.apache.org/docs/2.0/mod/mod_expires.html