friendly url in categories

Posted by ntan on Stack Overflow See other posts from Stack Overflow or by ntan
Published on 2010-04-22T06:42:24Z Indexed on 2010/04/22 6:43 UTC
Read the original article Hit count: 305

Hi to all,

i am trying to use friendly url for my categories.

Example Database

cat_id    |   parent_id    |  name     |     url
  1               0            cat1          cat1
  2               1            cat2          cat2

My approach to do is to pass the parameter cat with url value for example show.php?cat=cat1 and in .htaccess i must rewrite to /cat1

BUT what about when i want to access cat2. I want to rewrite as cat1/cat2 so the parameter is show.php?cat=cat1/cat2 and then parse the value to secure that cat2 belong to cat1.

And so on.

I am not using MVC so i have to do it on my own.

Please if any other solutions is better please advice or suggest me reading

Thank in advance.

© Stack Overflow or respective owner

Related posts about seo

Related posts about .htaccess