| URL Rewrites...Good or Evil? |
|
|
|
| SEO/SEM | |
| Written by Lyris HQ Staff Writer | |
| Thursday, 20 March 2008 | |
In modern day web development, URL rewriting is becoming more common. Never heard of it? I'll be glad to explain: URL rewriting is the practice of converting a URL from one format to another by the web server at run time.
But why would you be interested in converting URL formats? There are actually many reasons for using URL rewriting. The biggest reason is for search engine optimization purposed. This is especially prevalent in large, complex sites. Some search engines (like Google) have built-in algorithms that help determine ranking and relevancy of sites in their listings. One of the parts of that algorithm counts high numbers of URL parameters in web page URLs as potentially fraudulent behavior. We'll go further in depth as to the reasoning behind this rule in another article. Now, to work within the algorithm parameters, web developers have started using URL rewriting techniques. The idea is to rewrite the URLs on the web site in such a way that it convinces search engine spiders that the website is static (and doesn't make use of URL parameters) when in fact it is a dynamic website with several URL parameters being passed around. For example: www.mysite.com/product.php?catid=123&prodid=345&lang=en®ion=CA&r=1 Notice the several parameters being passed from page to page. Now since these parameters could appear to be fraudulent to the search engines, the URL could be rewritten into the form: www.mysite.com/product.php/catid=123/prodid=345/lang=en/region=CA/r=1 Notice that the "&" have been replaced with "/", effectively making it look like the URL parameters are actually folders on the web server, giving the appearance of a static web site. There are many such rewrite rules that a web developer could use to modify the URL. Now, you may be thinking, "Great! Sign me up!" Well... slow down tiger... there are some considerations to keep in mind. You need to ask yourself what it means to implement URL rewriting. The typical implementation is as follows: Visitor types in domain name ' web server rewrites URL hyperlinks on the web page into a more friendly format ' web server renders the page. Then the visitor will click on a hyperlink and request an already rewritten URL, but in order to make sense of the rewritten URL (since this URL doesn't actually exist on the web server), the web server must convert the rewritten URL back into the original format with URL parameters. Once it's executed this original URL, the web server then logs this original URL to the log file. And that's where a potential problem occurs. As a result of all of this writing and rewriting, what effectively happens is that the requested URL and the logged URL are different. This can cause some issues when it comes to analytics. For example, this means trouble for ClickTracks' Navigation report. In the Navigation report, we show you the live web site as it looks right now. All the hyperlinks on the pages that you browse will be the rewritten URLs. Now, in order to calculate how many people click on any given link and display overlaid metrics on the links, we must match up each hyperlink with an entry on the log file. If we find 10 instances of a request to a particular URL, then we overlay the corresponding percentage on top of the corresponding hyperlink. In the case of URL rewriting, there will never be a match between the hyperlinks on the live site and the entries in the log file. Therefore, all of your links appear to have 0% clicks within the Navigation Report. Oh, man... now what do you do? Not to worry my fellow ClickTrackers, there's still hope. One of two things can be done.
For more information, check out the following link for a description of popular URL rewriting procedures: Apache - http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html Comments (0)
![]() Write comment
|
|
| < Prev | Next > |
|---|





In modern day web development, URL rewriting is becoming more common. Never heard of it? I'll be glad to explain: URL rewriting is the practice of converting a URL from one format to another by the web server at run time.

