Forum Moderators: phranque
RewriteEngine on
RewriteRule ^subaction/showfull/id/([0-9]+)/ucat/([0-9]+) /manufacturers/automobile/atv.php?subaction=showfull&id=$1&archive=&start_from=&ucat=$2
RewriteRule ^subaction/showfull/id/([0-9]+)/ucat/([0-9]+) /manufacturers/automobile/auto-bearing.php?subaction=showfull&id=$1&archive=&start_from=&ucat=$2
it works great for the atv.php however when i go to auto-bearing.php and click one of the links there it goes to the re-written url but atv.php main page opens with th e listings. I guess it doesn't see the second line.
Any ideas would really be appreciated.
Sincerely,
That's because the patterns in your two rules are identical. So any request that would match the second rule will also match the first. Therefore, the second rule will never be applied.
I suspect you misunderstood how mod_rewrite works: Any requested URL that matches the pattern on the left side of the rule will be rewritten to the URL-path on the right side.
This recent [webmasterworld.com] thread has an explanation of mod-rewrite's action, and may be helpful to you.
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim