Page to category: mysite.com/products/Accessories.html Page to subcategory: mysite.com/Accessories/Headphones/3.html Page to product: mysite.com/product/Sony-Headphones/SPO30.html Here's the rule for the product page (works): RewriteRule (.*)product/(.+)/(.+).html /showproducts.php?cat=$2&subcat=$3 Here's the other rule(works for category page): RewriteRule (.*)/(.+).html /showproducts.php?cat=$1&subcat=$2 Now.. I need a rule for the subcategory page... but am unsure how to write it.. heres the dynamic part.... /showproducts.php?cat=$variable1&subcat=$variable2&page=$variable3 example: mysite.com/(variable1)/(variable2)/(variable3).html Can anyone help?
Even if you don't know the answer.. if you know a better place for me to ask (another forum) just post it or PM me.
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^(.*)/(.*)/(.*).html$ showproducts.php?cat=$1&subcat=$2&page=$3 [L] RewriteRule ^(.*)/(.*).html$ showproducts.php?cat=$1&subcat=$2 [L] RewriteRule ^(.*).html$ showproducts.php?cat=$1 [L] And make sure you don't have domain.com/index.html or other whatever.html files on the site, or they won't work. (Change .html to .something-else in .htaccess and script if you do have .html static pages.
Right. If you have it in the wrong order, mod_rewrite will freek out!!!! Wait, that URL goes to that page. No, to that page. er wait, that page. Bah, I give up. I'll give you nothing.