Archive for the 'SEO' Category
(Chronologically Listed)
Craft and optimize your friendly-URLs
- Posted by Tengku Zahasman on May 8th, 2007 filed in Web App Development, SEO
- 1 Comment »
- (279 Views)
Using friendly-URLs in your web application is essential when it comes to SEO (Search engine optimization). Friendly URLs (or some might refer to it as “Clean URLs” or “Pretty URLs”) help search engines’ crawlers to read your URLs and understand better what the page is mainly about. It acts as an additional option to look for keywords apart from looking in the page’s content itself.
There are a few strategies of how people make their friendly URLs to look like. Consider the three examples below:
1. Using IDs without descriptive keywords
http://www.domain.com/items/23 <– that’s the ID of the item in the database
2. Using descriptive keywords without IDs
http://www.domain.com/items/the-name-of-the-item <– (eg: a blog post’s title)
3. Using both IDs and descriptive keywords
http://www.domain.com/items/23/this-is-the-name-of-the-item.html
Explanation
#1 doesn’t explain much…. so while it is cleaner to the eyes, it’s not really friendly to the search engines’ crawlers. You lose a lot of points by not utilizing keywords in your URL to describe your page item. However, this technique is not all useless because for links that doesn’t need descriptive URLs (eg: when doing paginations), this technique can be pretty handy.
#2 is what most people like to use for linking items. The idea is to make the URL “very friendly” so that every part of the URL is descriptive and contains only keywords. No numbers. No IDs. However, this is gonna bring some problem because by using this technique, the application will search for the item in the database based on its name, not the ID. It takes out the slug “the-name-of-the-item” from the URL, chop it, slice it, and then use the string to search for the exact name of the item in the database. What if in the future you decided to change the item’s name? At that point of time, the application won’t be able to look for the item anymore using the old URL. And this is not good. Because if your URL has already been indexed by a search engine, or if someone has linked to that item from his website, users who click on the link will reach an “Object not found”, unless they use the new URL.
#3 is my favorite technique when creating friendly URLs and one that I recommend the most. Always include the ID. And always use the ID to look for the item in the database. The keywords at the end just describes the link. It doesn’t need to do anything else. This way, not only you save time (because you don’t have to write codes to slice the URL and look for the item based on the name), you also ensure that the item will be reachable no matter how many times you change its name. Afterall, that’s the main reason why people create IDs in the first place. 

If I've provided some info that you find to be useful, don't hesitate to