WordPress.org

Support

Support » How-To and Troubleshooting » .htaccess/expires headers issue

.htaccess/expires headers issue

  • I’m trying to optimize my site, so I created the following .htaccess file in my web root (http://expat.cl):

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault A300
    ExpiresByType application/x-javascript A3600
    ExpiresByType text/css A3600
    ExpiresByType image/gif A3600
    ExpiresByType image/png A3600
    ExpiresByType image/jpeg A3600
    ExpiresByType text/plain A300
    ExpiresByType application/x-shockwave-flash A3600
    ExpiresByType video/x-flv A3600
    ExpiresByType application/pdf A3600
    ExpiresByType text/html A300
    </IfModule>

    That, predictably, broke my permalinks, but I regenerated them and all was well. The file now looks like this:

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault A300
    ExpiresByType application/x-javascript A3600
    ExpiresByType text/css A3600
    ExpiresByType image/gif A3600
    ExpiresByType image/png A3600
    ExpiresByType image/jpeg A3600
    ExpiresByType text/plain A300
    ExpiresByType application/x-shockwave-flash A3600
    ExpiresByType video/x-flv A3600
    ExpiresByType application/pdf A3600
    ExpiresByType text/html A300
    </IfModule>
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    YSlow is telling me that I still don’t have my expires headers set (I do have some set via the Autoptimize plugin).

    Is there something wrong with the mod_expires settings above? Why is my server ignoring the file?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘.htaccess/expires headers issue’ is closed to new replies.
Skip to toolbar