Issues Facing for multiple htaccess rule for dynamic slug.
Mainly for an eCommerce website starting from which has Department,category,subcategory,subsubcategory and product
Sitepath are follows from department to subsubcategory
Without department path from category to subsubcategory
All the rules are written like below
#Rule 1
RewriteRule ^([A-Za-z0-9-]+)/?$ page1.php?department=$1 [L]
#Rule 2
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ page2.php?department=$2&category=$1 [L]
#Rule 3
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ page3.php?department=$3&category=$2&subcategory=$1 [L]
#Rule 4
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ page4.php?department=$4&category=$3&subcategory=$2&subsubcategory=$1 [L]
#Rule 5
RewriteRule ^([A-Za-z0-9-]+)/?$ page5.php?category=$1 [L]
#Rule 6
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ page6.php?category=$2&subcategory=$1 [L]
#Rule 7
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ page7.php?category=$3&subcategory=$2&subsubcategory=$1 [L]
#Rule 8
RewriteRule ^product/([A-Za-z0-9-]+)/([^./]*)/?$ product.php?slug=$2&seller=$1 [L]
Other Pages Rules except product related
#Rule 9
RewriteRule ^user/wishlist/?$ wishlist.php [L]
#Rule 10
RewriteRule ^cart/?$ cart.php [L]
Conflict occurs between
1. Rule 1 & Rule 5 & Rule 10
2. Rule 2 & Rule 6 & Rule 9
3. Rule 3 & Rule 7 & Rule 8
How to make uniqueness for each rules so that it hit to specific page and no conflict occurs.