I've used mod_rewrite (sparingly) in a few directories before without problems by putting in a .htaccess file for that directory, and it works there now. But when I try to use it in my top level directory, nothing happens!?!?! But that .htaccess file (top level one) is working fine otherwise. I have Redirect 301's and a variety of other things, but not mod_rewrite on. I'm running Apache 2.0.63 with mod_rewrite and mod_proxy loaded.
As a test case I set up the following 4 files (fileA,html, fileB.html, fileC.html, fileD.html) and put them in a /test directory. Each file contains the corresponding letters (e.g. AAAA, BBBB) so I can positively identify them. In the /test directory, I created a .htaccess file with
Redirect 301 /test/fileA.html http://www.xyz.com/test/fileB.html
RewriteEngine on
RewriteRule ^fileC\.html$ fileD.html
and all works as expected: you can only see fileB.html and fileD.html even when requesting A or C.
I then copied these files to the root html directory and added to the .htaccess there:
Options +FollowSymLinks (this was already there)
Redirect 301 /fileA.html http://www.xyz.com/fileB.html
RewriteEngine on
RewriteRule ^fileC\.html$ fileD.html
There are no other commands about these files in the .htaccess. Now you can see fileB.html and fileD.html but also fileC.html and not fileA.html!!! So mod_rewrite rule is NOT WORKING here and the Redirect IS working.
I've searched on the net in vain for ideas on this one. Anyone have a clue on what I'm doing wrong?