RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d


# product with category
RewriteRule ^productsList/([^/]+)/?$ product-list.php?cat=$1 [NC,L,QSA]

# product with category with page
RewriteRule ^productsList/([^/]+)/([^/]+)/?$ product-list.php?cat=$1&page=$2 [NC,L,QSA]

# product with subcategory
RewriteRule ^productsSubList/([^/]+)/?$ product-list.php?scat=$1 [NC,L,QSA]
# product with subcategory with page
RewriteRule ^productsSubList/([^/]+)/([^/]+)/?$ product-list.php?scat=$1&page=$2 [NC,L,QSA]

# product detail
RewriteRule ^details/([^/]+)/?$ product-description.php?url=$1 [NC,L,QSA]

# get all products
RewriteRule ^getproducts$ product-list.php [NC,L,QSA]
