B+,
Hmmm, the first "problem" I see is that you do not understand regex. Do you not think that the
EVERYTHING
atom will match "index.php/pretty" just as easily at it matches "pretty"?
Second problem is that you are abusing your server. WHY would you ask it to test whether mod_rewrite is enabled for EVERY request made to your website? I normally rant about a member NOT being a webmaster for such abuse but ...
The third problem is a little more innocuous: index.php/pretty is NOT a file that Apache can serve. Big surprise, I know! Okay, IF (and ONLY IF) you have enabled MultiViews can a "directory" in a path hijack the request (as you seem to prefer). Because MultiViews causes many problems, I prefer to turn it off and keep it off - which would cause your redirection to fail (in the manner it's doing now).
The fourth problem is that your mod_rewrite block statement is not terminated, i.e., no Last flag. You'd not get away with that in you PHP code so why would you do that with mod_rewrite? While you're at it, add an R=301 flag just so you can see that your mod_rewrite is working and has redirected to index.php/pretty (and can't find "pretty" in the index.php directory). Using the R=301 flag is a very useful troubleshooting tool as you can remove it to keep the redirection hidden once you've shaken out the bugs.
Edit:
Oh, yeah, the fifth problem is in using the RewriteBase command which is intended to UNDO a mod_alias redirection. Here, it does nothing useful (therefore, it should be removed) and it could cause problems by changing the base directory (DocumentRoot) when it's not expected. The message here is "don't use code you don't understand."
Regards,
DK
Bookmarks