...

View Full Version : How to make the date dynamic in header expiry attribute of htaccess



eshban
07-14-2011, 09:06 AM
Hi,

I am using the following code in my htaccess to "Expire Headers"


<FilesMatch "\.(ico|jgz|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "Thu, 21 July 2011 20:00:00 GMT"
</FilesMatch>


Currently, i have set the date as static. Is there anyway in htaccess to make this date dynamic.

Thanks

abduraooft
07-14-2011, 10:04 AM
Is there anyway in htaccess to make this date dynamic.
You could make a php script to edit the htaccess file and set it as a cron job.

DannyHerner
07-14-2011, 12:21 PM
<FilesMatch "\.(ico|jgz|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
ExpiresDefault A120
Header append Cache-Control "public, proxy-revalidate"
</FilesMatch>

A120 = 2 minutes (so replace 120 with your expire length
Above is the htaccess i use (just changed to your file extensions)

eshban
08-01-2011, 06:53 AM
The above code give errors



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum