user1967341
user1967341

Reputation: 13

.htaccess rewrite rules stops reading url after first part of string

Thank you for reading.

I am trying to rewrite all dynamic category links (/product_list.php?cat_id=xxx) to more "friendly" text links. The problem I'm running into is with subcategories:

RewriteRule Complete-AC-Systems product_list.php?cat_id=2

works great, however when a sub category is present:

RewriteRule Complete-AC-Systems__Packaged-Systems product_list.php?cat_id=7

the browser stops reading after Complete-AC-Systems and re-directs to product_list.php?cat_id=2 not cat_id=7

Most of our categories are 3 and 4 levels in, so this is a pervasive issue.

Thanks for any help you can offer.

Upvotes: 1

Views: 86

Answers (1)

chrskly
chrskly

Reputation: 999

How about reversing the order of the rules? I.e., putting the longest matches first.

Upvotes: 1

Related Questions