Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

mod_expires setting in .htaccess not working

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

  1. jazee

    jazee Well-Known Member

    Joined:
    Jan 12, 2015
    Messages:
    80
    Likes Received:
    1
    Trophy Points:
    8
    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:
    44,367
    Likes Received:
    1,857
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice