natimage Posted January 21, 2004 Share Posted January 21, 2004 (edited) OK...lets see if I understand this correctly: ExpiresActive On # Set default expiry to six hours after last access ExpiresDefault A21600 # Set expiry for image files to 30 days ExpiresByType image/gif A2592000 ExpiresByType image/jpeg A2592000 # Set expiry for error pages to zero <FilesMatch "^(error¦forbidden)\.html$"> ExpiresDefault A0 </FilesMatch> This should go into the .htaccess file of my public_html folder in order to apply the following rules to all documents within the public_html folder: set default expiration to 6 hours after last access set expiration to 30 days for gif and jpg files set expiration to 0 for error pages Question..can the comments in the script be left in the .htaccess file? Is there anything else I need to do to set this up? Thanks! OH...can someone explain to me why A2592000 30 days after access? I don't understand the logic of those numbers. Edited January 21, 2004 by natimage Quote Link to comment Share on other sites More sharing options...
Frylock Posted January 21, 2004 Share Posted January 21, 2004 I have no clue. I do know though that there are 2592000 seconds in 30 days. (Yeah, I'm such a big help.) Quote Link to comment Share on other sites More sharing options...
natimage Posted January 21, 2004 Author Share Posted January 21, 2004 Hey...help is help, Frylock!!! Thumbs Up Quote Link to comment Share on other sites More sharing options...
natimage Posted January 22, 2004 Author Share Posted January 22, 2004 'Nuther question. I read this in another forum that I found through google: I think one point that is sticky is this: Apache won't serve Last-Modified or Expires headers on files which SSI-include other files. Is that referring to things like, php includes for header and footer files? Quote Link to comment Share on other sites More sharing options...
vangrieg Posted January 22, 2004 Share Posted January 22, 2004 Is that referring to things like, php includes for header and footer files? No, that's only for SSI. Also, I'd like to say that you don't have to use this Axxxxx syntax. You can simply write, ExpiresByType image/jpeg "access plus 30 days" or ExpiresByType image/jpeg "modification plus 1 year" Quote Link to comment Share on other sites More sharing options...
natimage Posted January 22, 2004 Author Share Posted January 22, 2004 I've put the code into my .htaccess file in public_html folder. I've used a "Server header Checker" tool, but can't make heads or tails of most of it. Is there some other way of knowing whether or not my code is working? Quote Link to comment Share on other sites More sharing options...
natimage Posted January 22, 2004 Author Share Posted January 22, 2004 nevermind...I just figured it out!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.