The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mod_expires setting in .htaccess not working

Discussion in 'General Discussion' started by jazee, May 18, 2017.

  1. jazee

    jazee Active Member

    Joined:
    Jan 12, 2015
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    It appears mod_expires setting in .htaccess are not working despite EasyApache 4 config shows mod_expires is installed?

    GtMetrix and Google Pagespeed tests are both showing expiration of 1 day for jpeg images for example despite these settings in public_html/.htaccess
    Code:
    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType application/javascript "access 1 month"
    ExpiresByType application/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 2 days"
    </IfModule>
    ## EXPIRES CACHING ##
    
    Is there a WHM/Cpanel setting I'm missing or am I mistaken that mod_expires is installed and running?

    In one command I used, it shows up:

    [root@v1 public_html]# apachectl -M|grep expires
    expires_module (shared)

    In another it doesn't:

    [root@v1 public_html]# httpd -l
    Compiled in modules:
    core.c
    mod_so.c
    http_core.c

    I'm guessing httpd -l isn't the proper command? (I'm running Centos 6)
     
    #1 jazee, May 18, 2017
    Last edited by a moderator: May 18, 2017
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
Loading...

Share This Page