• Resolved wpress2010

    (@wpress2010)


    I have an WP install on an Apace server, shared hosting on Hostgator.

    At the top of the .htaccess file:

    # BEGIN Far Future Expiration Plugin
    <IfModule mod_expires.c>
    <FilesMatch “\.(gif|jpeg|jpg|png|js|css)$”>
    ExpiresDefault “access plus 360 hours”
    </FilesMatch>
    </IfModule>
    # END Far Future Expiration Plugin

    And yet, when I look at the site with a speed rating tool such as the one at Gtmetrix.com, it shows that NO image or CSS files have expiration dates! Does the Apache server have to be stopped/started for these rules to work?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You need something more like this:

    <IfModule mod_expires.c>
    ExpiresActive On
    ############################################
    ## Add default Expires header
    ## http://developer.yahoo.com/performance/rules.html#expires
    <FilesMatch "\.(gif|jpeg|jpg|png|js|css)$">
     ExpiresDefault "access plus 360 hours"
    </FilesMatch>
    </IfModule>

    Also, you need to ensure you have the “mod_expires” extension enabled on your server.

    Thread Starter wpress2010

    (@wpress2010)

    Thank you! That fixed it: missing line of code. I will forward to plug-in developer as he needs to see this.

    No worries.
    Sounds good.
    Always happy to help 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Expiry code in .htaccess not working’ is closed to new replies.