Note: REQUEST_URI is slightly different between httpd.conf and .htaccess, it starts with an extra backslash in httpd.conf. This means that in httpd.conf the first rewrite rule should be ^\/$, not just ^$.

thanks for trying, but the second rule picks up both requests an empty and non-empty request_uri. Any thoughts?
–
pchap10kApr 17 '11 at 13:55

1

Ok I worked it out, but your answer was very close. A: Apache never returns an empty request_uri, an empty request comes through as '/' so I just changed the first rewrite rule to ^\/$ and it works!
–
pchap10kApr 17 '11 at 14:06

1

@crunchyt: Your rewrite rules are in httpd.conf, correct? I tested mine in .htaccess. REQUEST_URI is slightly different between httpd.conf and .htaccess, it starts with an extra backslash in httpd.conf. Glad you have figure it out! :)
–
szemianApr 17 '11 at 16:58

Exactly, me too I had to use ^\/$, because I've put the rule in httpd.conf. It works like a charm, thank you all very much!
–
lucaferrarioFeb 6 '12 at 12:23