Reputation: 1834
I work with Opencart shopping system And have This .htaccess File:
# STARTNITRO
RewriteRule .* - [E=HTTP_IF_MODIFIED_SINCE:%{HTTP:If-Modified-Since}]
ExpiresActive On
#CSS JS XML TXT - 1 WEEK
<FilesMatch "\.(xml|txt|css|js)$">
Header set Cache-Control "max-age=604800, public"
ExpiresDefault "access plus 1 week"
</FilesMatch>
#JPG JPEG PNG GIF SWF SVG - 1 MONTH
<FilesMatch "\.(jpg|jpeg|png|gif|swf|svg|JPG|JPEG|PNG|GIF|SWF|SVG)$">
Header set Cache-Control "max-age=2674800, public"
ExpiresDefault "access plus 1 month"
Header set Last-Modified "Wed, 05 Jun 2009 06:40:46 GMT"
</FilesMatch>
#OTF WOFF TTF ICO PDF FLV - 1 MONTH
<FilesMatch "\.(otf|ico|pdf|flv|woff|ttf)$">
Header set Cache-Control "max-age=2674800, public"
ExpiresDefault "access plus 1 month"
</FilesMatch>
# ENDNITRO
# STARTCOMPRESSNITRO
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(\/?((catalog)|(assets)).+)\.css$ assets/style.php?l=9&p=$1&c=604800 [NC,L]
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(\/?((catalog)|(assets)).+)\.js$ assets/script.php?l=9&p=$1&c=604800 [NC,L]
Now, When i see my page i see error :
Server error!
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.If you think this is a server error, please contact the webmaster.
Error 500
how do can i fix this error ?!
Upvotes: 0
Views: 965
Reputation: 143876
[Mon Mar 09 23:08:08.289609 2015] [core:alert] [pid 4856:tid 1668] [client ::1:53855] C:/xampp/htdocs/shop/.htaccess: Invalid command 'ExpiresActive', perhaps misspelled or defined by a module not included in the server configuration
This means you don't have mod_expires loaded. You need to uncomment out that line in the httpd.conf or use a2enmod
if you have that. Make sure to restart apache.
See this answer: Apache crashing when I add Far-Future Expires clause from Rails Guide
Upvotes: 2