mod rewrite - Apache htaccess rule priority -
i know .htaccess rules parsed top bottom if url matches 2 rules 1 used , why?
i have simple rules like
^(.*)$ index.php?pag=cms&title=$1 ^store/(.*)$ index.php?pag=store&id=$1 basically url match first rule happens other ones?
if url matches 2 rules, it's first 1 rewrites. not second rule doesn't fire. fails match because subsequent rules fire on output of rule preceding it.
if somehow don't want rewrite fall-through , stop @ first matching rule can mark rule last using [l] flag.
^(.*)$ index.php?pag=cms&title=$1 [l] ^store/(.*)$ index.php?pag=store&id=$1 # won't fire
Comments
Post a Comment