zeeshan
03-17-2005, 09:09 AM
Hi,
I'm trying to create search engine friendly urls for my site. The site structure looks something like this:
Category1
-Article1
-Article2
-Product1
-Sub-catetory
--Article3
--Article4
--Product2
--Quiz1
Category2
-Article5
-Quiz2
Basically, there are 2 levels of categories and there can be an Article, a Product or a Quiz at any level.
I need the URLs to look like folders.
mysite.com/category1/category2/article1/
mysite.com/category1/quiz2/
mysite.com/category1/category2/product2/
what i'm thinking to do is to pick the last bit from the url and search in the DB tables with the item name to identify if its an Article, a product, a quiz or just a sub category. obviously in this case i'll have to define unique names for all items and it also means that before displaying the page i'll have to query the DB 4 times jus to find out the type of item.
Could anyone suggest a better solution to this problem. I'ev read the forum but couldnt find any solution.
Many Thanks.
I'm trying to create search engine friendly urls for my site. The site structure looks something like this:
Category1
-Article1
-Article2
-Product1
-Sub-catetory
--Article3
--Article4
--Product2
--Quiz1
Category2
-Article5
-Quiz2
Basically, there are 2 levels of categories and there can be an Article, a Product or a Quiz at any level.
I need the URLs to look like folders.
mysite.com/category1/category2/article1/
mysite.com/category1/quiz2/
mysite.com/category1/category2/product2/
what i'm thinking to do is to pick the last bit from the url and search in the DB tables with the item name to identify if its an Article, a product, a quiz or just a sub category. obviously in this case i'll have to define unique names for all items and it also means that before displaying the page i'll have to query the DB 4 times jus to find out the type of item.
Could anyone suggest a better solution to this problem. I'ev read the forum but couldnt find any solution.
Many Thanks.