Friday, 3 February 2012

Rewrite dynamic URLs

A common problem for online stores, forums, blogs or other database-driven sites is: pages often have unclear URLs like this: www.weddinggift.com/?item=32554, and you cannot say which good or article it leads to. Though instead, they could have www.weddinggift.com/silk-linen.html, or www.weddinggift.com/pots.html, where you can easily see what's on the page.

So the problem with such URLs like this one www.weddinggift.com/?item=32554 is: no one (neither users, nor even the Robot) can tell what product can be found under the URL.



URLs like this, www.weddinggift.com/?item=32554, having parameters (here it's item=32554) are called Dynamic URLs, while URLs like http://www.weddinggift.com/silk-linen.html are static. First of all, static URLs are much more user-friendly. For users, URLs with too much of "?", "&" and "=" are hard to understand and pretty inconvenient. Secondly, search engines like static URLs much better than dynamic ones.

I probably wouldn't believe this myself, but one of the biggest players in SEO industry confirmed that their search traffic jumped 20% due to static URL use instead of dynamic URLs.

It's possible that you also need static URLs but have dynamic ones instead. But, I wouldn't talk so much of this problem, if it couldn't be solved. There's a nice trick to make URLs look good to Search Engines.

A .htaccess file is a plain-text file, and using it, you can make amazing tricks with your web server. Just one example is rewriting dynamic URLs. And then when a user (or a robot) is trying to reach a page, this file gets a command to show a page URL that is user- and crawler-friendly.

This is, basically, hiding dynamic URLs behind the SE-friendly URLs. I'll give you an example for an online store.

As a rule, a page URL for some product looks like this:
http://www.myshop.com/showgood.php?category=34&good=146

where there are two parameters:
category — the group of goods
good — the good itself

At the same website, you may be offering Dove soap in the category of beauty products, having the URL:
http://www.myshop.com/showgood.php?category=34&good=146

A bra by Victoria's Secret, under the URL:
http://www.myshop.com/showgood.php?category=56&good=54146

To Search Engines, both pages appear like showgood.php. They just can't understand that these are two different pages offering two different products.

You can rewrite pages, so the Robot will see

http://www.myshop.com/beauty-products/dove-soap.html
instead of the first URL, for Dove soap
http://www.myshop.com/showgood.php?category=34&good=146

and

http://www.myshop.com/victorias-secret-underwear/bra.html
instead of the second one, for Victoria's Secret bra
http://www.myshop.com/showgood.php?category=56&good=54146

and you'll get "speaking URLs" that are understood by the Robot and easy to check.

Writing an .htaccess file is an uneasy task that requires special knowledge. Moreover, it's your webmaster's business. I personally never do this myself. So if you have a database-driven site, search the web for a special SEO service that will write a .htaccess file for you.

Or, if you're using a fairly well-known 3rd-party engine, you can write the .htacess file yourself, using some scripts that you can find in the Internet. To do the search, you can type in the_name_of_your_site's_engine "URL Rewrite" htaccess or something like that.

For instance, I used the following query: phpBB "URL Rewrite"

And got a number of results:

Now, the idea is: it's of great use to rewrite URLs. So find the URL rewrite tools if you need them — or just find your webmaster.

Then, one more thing, the old URLs that have parameters should be "hidden" from Search Engines. Next point helps you do that.



No comments:

Post a Comment