Welcome Guest, Not a member yet? Register   Sign In
SEO-friendly URL's
#1

[eluser]jplanet[/eluser]
I am working on a CI ecommerce project. There are three main levels to the site:

- List of top-level categories
- List of subcategories under each category
- List of products under each sub-category

In the database, the Category and products tables both have a column called static_name. This is a plain-English name representation of the product or category, so that URL's can look like:

List of sub-categories for a given category:
www.example.com/category/Kids-Toys

and for product lists under each subcategory:
www.example.com/products/Board-Games

Now, this already seems quite optimized to me. My client is wondering if there would be any benefit to getting rid of the function names entirely, so that URL's would only contain they key, whether it was a category or product list:

www.example.com/Kids-Toys
and
www.example.com/Board-Games

To do this I would have to enforce a rule that every product and category must have a unique value in the static_file field. Then every URL request would run a query to see which table contains the value, and delegate to the applicable function.

Does this seem like a fundamentally bad idea? It strikes me that this structure could be quite fragile to maintain...Is there even anything gained as far as SEO goes, or is there some benefit that may be worth the trouble?
#2

[eluser]Jim OHalloran[/eluser]
[quote author="jplanet" date="1192874821"]Is there even anything gained as far as SEO goes, or is there some benefit that may be worth the trouble?[/quote]My understanding is that the idea behind SEO friendly URL's is to pack your keywords into the URL itself. I'm under the impression (but happy to be corrected) that there would be no difference at all (SEO wise) between www.example.com/products/Board-Games and www.example.com/Board-Games. Provided the search terms are there, I'm sure Google is smart enough not to be distracted by any other words in the URL.

Jim.
#3

[eluser]esra[/eluser]
[quote author="jplanet" date="1192874821"]To do this I would have to enforce a rule that every product and category must have a unique value in the static_file field. Then every URL request would run a query to see which table contains the value, and delegate to the applicable function.[/quote]

I believe that Jim assumption about SEO is correct. It's also an assumption on my part but makes logical sense.

You could store your category/subcategory and product content in one table and manage the hierarchies in a separate table using the nested sets model or the adjacency list model. Just use a join to handle the table relationships. For example:

Content columns:

Quote:id
static_name
name
short_description
long_description
...
created
created_by
modified
modified_by

Nested set table columns:

Quote:id
content_id
nleft
nright

Thunder UK has posted a model on the wiki for handling nested sets. The categories example included with the contribution probably could be used as a starting point for your own hierarchies.

Adjacency List columns:

Quote:id
content_id
parent_id

I believe thatthere are multiple posts about using the Adjacency List model (recursion) on the forum but no wiki article that I am aware of.

The combination of id and content_id creates a unique relationship in your hierarchies. Thus, you can handle many-to-many category/product relationships in your queries.
#4

[eluser]jplanet[/eluser]
Thanks for the replies. I have seen the posts regarding the nested sets and adjacency lists. What I have is more similar to adjacency...a parent id column in categories for infinitely nestable categories, but products can belong to any number of categories, so I have a separate many-to-many table for ProductCategories:

- product_id
- category_id

So, I suppose the real question is whether there is any benefit SEO-wise to reduce the URL to contain only a product or category key, without specifying the function name...My guess is that it's likely not an issue, but perhaps more of a general SEO question rather than something specific to CodeIgniter...




Theme © iAndrew 2016 - Forum software by © MyBB