I seem to be having trouble with Apache 2.2's Rewrite module (running on FreeBSD 8). My .htaccess file is as follows:
Options -Indexes RewriteEngine on RewriteRule ^xpaste$ cross.php [L] RewriteRule ^x([a-f0-9]*)$ cross.php?id=$1 [L] RewriteRule ^(gen|[a-f0-9]+)$ index.php?$1 [L] RewriteRule ^(.*)$ index.php [L]
Yet somehow, the last rule overrides the other three. As soon as I comment it out, the other rules work as expected:
www.mysite.com/xpaste opens "cross.php"
www.mysite.com/x132633 opens "cross.php?id=132633"
www.mysite.com/gen opens "index.php?gen"
I've tried various combinations of L, NS, and S=n flags on each RewriteRule, but unless I comment out the last rule, everything gets directed to index.php. How do I make Apache stop processing the RewriteRules once it finds a match?