Writing .htaccess mod rewrite for hierarchical categories

Posted by NetCaster on Stack Overflow See other posts from Stack Overflow or by NetCaster
Published on 2010-05-13T02:22:09Z Indexed on 2010/05/13 2:24 UTC
Read the original article Hit count: 333

Filed under:
|
|
|

i need to rewrite urls for my classified ads directory

i have 4 types of links

/City ==> display all ads in city

/City/Cat1 ==> display all ads in city + category

/City/Cat1/Cat2 ==> display add ads in city + category 1 + category 2

/City/Cat1/Cat2/Ad-id ==> display the ad itself and pass cat1 cat2 and city variables

original hidden url should be index.php?city=alexandria&cat1=cars&cat2=bikes&adid=EWSw22d

Can you please help me writing .htaccess for this structure

© Stack Overflow or respective owner

Related posts about .htaccess

Related posts about mod-rewrite