Forum Moderators: phranque

Message Too Old, No Replies

Error 500 what is wrong with this .htaccess lines

Problem with redirect on no accept encoding !gzip

         

jetteroheller

6:56 am on Mar 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I mixed this 2 lines together from one post in webmasterworld
and one other line to redirect to a certain URL

RewriteCond %{HTTP:accept-encoding}!gzip
RewriteRule .*\.(htm)$ [cgi.example.com...] [L]

But seems - error 500 - I made something wrong.

The problem: I deliver all htm and js gzip compressed.
All modern browsers, Lynx and MSIE 5 included, can gzip compressed.

But there are sometimes proxy servers unabel for gzip delivery.

I thought to redirect with this line to a page on the only subdomain delivering uncompressed with a message there.

g1smd

8:11 am on Mar 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Your code delivers a 302 redirect.

Did you want a 301 redirect or did you want a rewrite instead?

There's no need to bracket the (htm) part if you are not using it as a back reference.

jetteroheller

9:05 am on Mar 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I would like to give a 307

jdMorgan

5:07 pm on Mar 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There appears to be a space missing before "!gzip" in your RewriteCond.

If you are rewriting or redirecting to a URL that will match the pattern in your rule, you must specifically exclude the rewritten URL from being rewritten again (and again, and again) by using a negative-match RewriteCond.

I see no reason to redirect the client; It seems that an internal rewrite would be appropriate.

Jim