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 for all

Discussion in 'General Discussion' started by martin.henits, Aug 5, 2010.

  1. martin.henits

    martin.henits Member

    Joined:
    Aug 5, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    51
    Hi all,

    I have enabled mod_expires on my server and want to enable it for all of my users.
    I want to have it like:

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 seconds"
    ExpiresByType text/html "access plus 1 seconds"
    ExpiresByType image/gif "access plus 1 week"
    </IfModule>

    for some reasons I don't want to do it using .htaccess files for each user.

    Can I add the code to one place so that it could be applied to all virtual hosts?
     
  2. martin.henits

    martin.henits Member

    Joined:
    Aug 5, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    51
    no effect

    I put the following lines in /usr/local/apache/cong/userdata/modexpires.cnf

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 seconds"
    ExpiresByType text/html "access plus 1 seconds"
    ExpiresByType image/gif "access plus 1 week"
    ExpiresByType image/jpeg "access plus 1 week"
    ExpiresByType image/png "access plus 1 week"
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType text/javascript "access plus 1 week"
    ExpiresByType application/x-javascript "access plus 1 week"
    ExpiresByType text/xml "access plus 1 seconds"
    </IfModule>

    but it seems to have no effect !
     
  3. martin.henits

    martin.henits Member

    Joined:
    Aug 5, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    51
    solved

    ahh a silly mistake!

    the file extension should be .conf
     
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