I recently was asked to develop something for a client that seemed a little ill-conceived. This is a very particular client who is very involved with his work. He knows exactly what he wants and is very organized. Usually, I just assume he's got the right idea and code away. He seems like a pretty savvy business man. But this time, it was a bit different. I felt there was a better way.
He wanted to have a list of products he could manage through our content management system and link each product to a different webpage where he would add content through the same content management system about the product. Each product would have its own page. Ew.
I told the project manager that it would be better if we just had one page for the categories and one page for the products. You would pass an id of the category into a query string for the category page and a product id into a a query string for the product page. Much easier for the client. The project manager told me that the client didn't care about things like that because he was more concerned about search engine results than his time. I replied by saying that it didn't matter: search engines crawl dynamic URLs on pages. The project manager wasn't too certain, and I wasn't really an "expert" on the subject, either, so I kind of tabled the decision and decided to look it up a bit.
The very first page I found, located here, explained it really well. The article states that, though search engine spiders do crawl through sites, they have some serious - and very understandable - limitations. The synopsis of the important points about query strings are:
- Keep them short. Less variables gain more visibility.
- Keep your variable names short, but do not use 'ID' or composites of entities and 'ID'.
- Hide user tracking from search engine crawlers in all URLs appearing in (internal) links. That's tolerated cloaking, because it helps search engines. Ensure to output useful default values when a page gets requested without a session ID and the client does not accept cookies.
- Keep the values short. If you can, go for integers. Don't use UUIDs/GUIDs and similar randomly generated stuff in query strings if you want the page indexed by search engines. Exception: in forms enabling users to update your database use GUIDs/UUIDs only, because integers encourage users to play with them in the address bar, which leads to unwanted updates and other nasty effects.
These are pretty important rules I'll remember for all my consulting days. The website, http://www.smart-it-consulting.com/, sounds like a pretty nice site for us consultants to check out in general :)