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 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:
    1
    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:
    1
    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:
    1
    solved

    ahh a silly mistake!

    the file extension should be .conf
     

Share This Page