Hi, I want to have this sort of structure for showing category / subcategory pages: http://www.domain.com/categoryName/page1.html http://www.domain.com/categoryName/subCatName/page1.html Is there any way I can make these point to utilize different php files? If I use anything like: RewriteRule ^(.*)/page(.*)\.html$ catPage.php?catName=$1&page=$2 [L] RewriteRule ^(.*)/(.*)/page(.*)\.html$ subCatPage.php?catName=$1&subCatName=$2&page=$3 [L] Code (markup): It won't work because it takes the whole of "categoryName/subCatName" as the catName variable... I'm not actually very experienced with mod_rewrites but would this problem be solved by using regex? Like changing the (.*) to ([^/]*)? Thanks, Hodge
There's only one way to find out - try it! But yes, that change to the regex pattern should sort you out.
Agreed - but I only thought of it after I posted the original post, so I decided to edit the post and ask rather than testing it out first.