开发者

Set "expires" header for a whole directory

开发者 https://www.devze.com 2023-04-09 11:32 出处:网络
So let\'s say: - .htaccess * assets > images |> logo.png > css |> style.css |> home.css How c开发者_StackOverflow中文版an i set the expires header for the whole assets folder and

So let's say:

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

How c开发者_StackOverflow中文版an 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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消