views:

474

answers:

1

I have a redirect in Apache config like

Redirect temp /foo.xml http://www.baz.com/foo.xml

I am trying to add an Expire and m-cache headers for a CDN to this 302. This would be trivial in php, but I need to do this in Apache config files.

Normally this is done like this:

ExpiresActive On ExpiresDefault "access plus 10 minutes"

but this only seems to not work for 302 redirects. Any suggestions?

+1  A: 

Check out the mod_headers module for Apache.

Perhaps something like:

<Location /foo.xml>
   Redirect temp /foo.xml http://www.baz.com/foo.xml
   Header set ExpiresActive On
   Header set ExpiresDefault "access plus 10 minutes"
</Location>
Richard
Except, this doesn't actually work because the headers aren't added when a redirect is done.
calmh