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.example.com/xpaste
openscross.php
www.example.com/x132633
openscross.php?id=132633
www.example.com/gen
opensindex.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 RewriteRule
s once it finds a match?