I made a website that has a hierarchical structure and has search engine friendly (SEF) URLs like:
/seeds-1/
/seeds-1/fruits-2/
/seeds-1/fruits-2/black-berries-5/
/seeds-1/fruits-2/blue-berries-6/
/seeds-1/fruits-2/strawberries-7/
/seeds-1/vegetables-3/
/seeds-1/vegetables-3/potato-8/
/seeds-1/vegetables-3/onion-9/
/seeds-1/vegetables-3/cabbage-10/
/seeds-1/flowers-4/
/seeds-1/flowers-4/red-rose-11/
/seeds-1/flowers-4/tulips-12/
and so on. You’ll notice that the numbers at the end are IDs. Now that I am done with the website and everything, a “consultant” intervenes and tells my client that “… urls are not 100% search engine friendly, to make them 100% search engine friendly, the numbers must be removed…”. I obviously cannot talk to the “consultant” as they have done their job and disappeared.
I’ll now appreciate if someone can point out the PROs and CONs for both types of URLs. I need some solid arguments to convince the client plus I really need to know if I’ve made a mistake choosing this kind of URL scheme for my website.
Edit —-
May be I am being lazy. The rewrite rules look like:
RewriteRule ^[^/]+-([0-9]+)/$ object.php?ObjectID=$1
RewriteRule ^[^/]+-([0-9]+)/[^/]+-([0-9]+)/$ object.php?ObjectID=$2
.
.
.
Its fairly easy to extract the ObjectID from query-string, cast it as an integer and use it in SQL query. I think using text comparison in queries (WHERE Name = ‘%s’) is slower compared to using integer comparison (WHERE ObjectID = %d), therefore I am hesitating. The question is more like is it worth making the URLs more human-friendly at the cost of making them less coding/performance friendly.
Agree with cherouvim and will expand.
Two things to consider here –
Human friendly is one point…if your user wants to type in vegetables/onions/vidalia instead of vegatables/onions-10, then it obviously makes more sense to the end user.
Also, the search engine could also pick up on a little more detail as well…so a search for vidalia onion may yield a better ranking for your website.
In the end, the consultant is promoting the buzzword of readability. Yes its probably overall better in the long run (and should be as simple as writing a nice little .htaccess file to fix), but there’s really nothing wrong with your setup.
Edit
Honestly, it really boils down to what your customer wants. As other users have also specified, there really isn’t much of a performance difference in how you present the links…
What really matters now is if your client wants it presented. Do they care if this sort of information is readable by humans? If they’re just going to take the consultant’s advice then you might as well just implement your rewrite rules.