Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I need to add below directives to apache. But I get 500 when I add these lines.

<LocationMatch "^/assets/.*$">
Header unset ETag
FileETag None
# RFC says only cache for 1 year
ExpiresActive On
ExpiresDefault "access plus 1 year"
</LocationMatch>

Additionally response is not gzipped when I add:

AddOutputFilterByType DEFLATE text/html text/css application/javascript application/x-javascript

Apache version is: Server version: Apache/2.2.22 (Unix)

App: rails 3.2 app

When I checked response&request for gzip problem, I see that browser requested gzip:

Accept-Encoding gzip, deflate

but response not gzipped.

share|improve this question
    
I solved gzip error, but I still cannot add LocationMatch directive in my htaccess file –  tackleberry Mar 30 '12 at 14:31

1 Answer 1

up vote 0 down vote accepted

Ok I fixed it, LocationMatch directive on .htaccess files are not permitted. see: Apache docs

So I placed these directives into my vhost in httpd.conf file, and now everything is great.

share|improve this answer
    
It would be nice if you add the directives to the answer. –  Lucas Kauffman Mar 31 '12 at 13:04
    
@LucasKauffman sorry to mention about that. I didn't change directives, they are all same as my original question. I just opened my httpd.conf file, and paste them in domain vhost section –  tackleberry Mar 31 '12 at 19:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.