Forum Moderators: phranque
I have this two rules:
RewriteRule ^(.*?)-([^/]+).html$ /page1.php?id=$1
RewriteRule ^(.*?)-([^/]+)/(.*?)-([^/]+).html$ /page2.php?id=$3
the problem is that if I use this url:
www.example.com/22-mycategory.html
or this one
www.example.com/2-mycategory/44-mypage.html
rewrite always use the first rule anc call page1.php.
what can I do to differentiate the two rules without change the url format?
I just tried to invert the rules order without no results...
thank you
best regards
Manuel
(.*) which matches "everything" - and then has to back off and retry many many times. You also need to add the
[L] flag to both rules. To avoid "wildcard malicious duplication" issues, you need to pass ALL variables through the rewrite and check their values are correct using your script. Incorrect values, and incorrect combinations must trigger the script to return a proper 404 HTTP status in the HTTP header.
See also: [webmasterworld.com...]