quick question for those who know a little more about mod-rewrite than i do:
I have some rules written in sequence like so:
RewriteRule ^(en|fr) index.php?page=home&lang=$1 [L]
RewriteRule ^(en|fr)/home index.php?page=home&lang=$1 [L]
RewriteRule ^(en|fr)/terms index.php?page=terms&lang=$1 [L]
however the first one seems to be over-riding the rest.
I’ve tried taking off the [L] but this doesnt do what I expected and it will never show the “terms” page.
Any ideas?
If you want
http://www.example.com/enorhttp://www.example.com/fr/(with or without trailing slash) to redirect to the first item, change the first rule to be:RewriteRule ^(en|fr)/?$ index.php?page=home&lang=$1 [L]The
/?matches whether or not there’s a trailing slash and the$means “match the end of the URL” (don’t match if the URL continues).