2

Somehow I need to confirm how htaccess expires headers works when used in the home directory as well as subdirectories.

Let's say I have this in the home directory's htaccess:

ExpiresActive On 
ExpiresByType image/gif "access plus 1 month"

Then let's say I have this in an htaccess in a /thumbnails/ subdirectory:

ExpiresActive On 
ExpiresByType image/gif "access plus 1 year"

So globally on the site, GIF images are meant to cache for a month, but for the /thumbnails/ directory, GIF images are meant to cache for a year. Am I correct in assuming that the htaccess in the /thumbnails/ directory will override the htaccess in the home directory? Or is it vice versa? Any documentation confirming as such?

0

1 Answer 1

1

Your assumption is correct. The Apache's documentation for any directive consists of a section called Context.

The precedence follow the rules base on AllowOverride directive. If your server is configured to allow overriding for the Expires module, then the configuration from /thumbnails/ will take precedence.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.