开发者

Set "expires" header for a whole directory

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜