Pankaj
Pankaj

Reputation: 10115

Error when trying to fix

This is about fixing an issue: LEVERAGE BROWSER CACHING(expiration not specified)

I added the following lines of code in .htaccess

<FilesMatch "(?i)^.*\.(js|css)$">
    ExpiresActive On
    ExpiresDefault A2592000
</FilesMatch>

It works perfectly on server but on localhost, it says

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script

Am I missing anything?

Upvotes: 2

Views: 119

Answers (1)

Marcin Nabiałek
Marcin Nabiałek

Reputation: 111889

Write it like this:

<ifmodule mod_expires.c>
<FilesMatch "(?i)^.*\.(js|css)$">
    ExpiresActive On
    ExpiresDefault A2592000
</FilesMatch>
</ifmodule>

If it will be working it means mod_expires is not active on your server

Upvotes: 2

Related Questions