tommyda Posted July 28, 2009 Share Posted July 28, 2009 Hi im not sure if im posting on the right topic but i cant find a mores suitable one. Im developing a shopping cart system for a client but have hit a brick wall with the url structure vs the category system I originally wanted to have Categories and subcategories. Which would have mod rewritten as follows: categories.php?cat=necklaces Site.com/products/necklaces categories.php?cat=necklaces&sub=glass Site.com/products/necklaces/glass categories.php?cat=necklaces&sub=glass&product=gold-coin Site.com/poducts/necklaces/gold-coin On looking at other seo freindly shopping carts i noticed they have much simpler url structures but have the option for unlimited cats and subs. EG: site.com/categories/necklaces site.com/categories/glass-necklaces site.com/products/gold-coin-necklace Which would be best to stick with in your opinion from both an seo and a coders point of view? Regards Tommy Link to comment https://forums.phpfreaks.com/topic/167784-unlimited-categories-sub-categories-or-better-seo/ Share on other sites More sharing options...
patrickmvi Posted July 28, 2009 Share Posted July 28, 2009 I think you could still use the forward slashes however you'd have to anchor the beginning to something constant like categories or products. If it were me I would have it like this: /categories/gold/jewelry/necklaces I would have that translate to category.php?categories=gold/jewelry/necklaces Then in my code for category.php, I would explode the $_GET[categories] variable on the "/" and figure out my actual categories that way. This would allow you to go infinately while still using the "/" which I think in general looks more normal than separating things with other characters. Link to comment https://forums.phpfreaks.com/topic/167784-unlimited-categories-sub-categories-or-better-seo/#findComment-884832 Share on other sites More sharing options...
tommyda Posted July 28, 2009 Author Share Posted July 28, 2009 Thanks Im looking into it now. Would be possible to have the product within the categories? or would it be best to have a seperate products section. EG: site.com/categories/cat1/cat2/product-343 or site.com/products/product-343 Also is there any way to make mod rewrite cover for unlimited subs? or would I have to manually write them out? RewriteRule ^categories/?$ categories.php [L] RewriteRule ^categories/([^/\.]+)/?$ categories.php?cat=$1 [L] RewriteRule ^categories/([^/\.]+)/([^/\.]+)/?$ categories.php?cat=$1/$2 [L] RewriteRule ^categories/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ categories.php?cat=$1/$2/$3/ [L] Link to comment https://forums.phpfreaks.com/topic/167784-unlimited-categories-sub-categories-or-better-seo/#findComment-884847 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.