CodeOverload
CodeOverload

Reputation: 48485

Set "expires" header for a whole directory

So let's say:

- .htaccess
* assets
 |> images
   |> logo.png
 |> css
   |> style.css
   |> home.css

How can i set the expires header for the whole assets folder and its contents?

I know that i can set it by type like:

ExpiresByType text/javascript "modification plus 2 hours 45 minutes"

But what about for a whole directory?

Upvotes: 1

Views: 1563

Answers (1)

Marc B
Marc B

Reputation: 360672

At the .conf level, use a <directory> directive:

<Directory  /path/to/your/assets/folder>
    ExpiresDefault ...
</Directory>

If you have only .htaccess control, then put a .htaccess into the assets folder with the same ExpiresDefault directive

Upvotes: 2

Related Questions