Does setting expire header for specific URI?

I am trying to set the expire header for a specific URI, but for some reason it does not work, what I have done so far in the httpd.conf file was this:

<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>

It just doesn't work for me. I have no expiration date headers for the content that I specified. I also don’t understand what exactly happens when you have two directives LocationMatchthat overlap the first priority?

+5
source share
3 answers

I'm not sure, but the docs don't mention LocationMatch as a possible context.

"Context: server configuration, virtual host, directory, .htaccess"

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

+2

, /mysite/contentservices/weather/get.json CGI/mod_php/- ?

, .

. http://httpd.apache.org/docs/2.0/sections.html

, , , , , :

<LocationMatch "/mysite/contentservices/weather/get.json">
  ExpiresDefault "access plus 1 day"
</LocationMatch>

.

+2

LocationMatch.

: - expires.

0

All Articles