May 29

URL Rewriting

What is “URL Rewriting”?

Most dynamic sites include variables in their URLs that tell the site what information to show the user. Typically, this gives URLs like the following, telling the relevant script on a site to load product number 7.

http://www.pets.com/show_a_product.php?product_id=7

The problems with this kind of URL structure are that the URL is not at all memorable. It’s difficult to read out over the phone (you’d be surprised how many people pass URLs this way). Search engines and users alike get no useful information about the content of a page from that URL. You can’t tell from that URL that that page allows you to buy a Norwegian Blue Parrot (lovely plumage). It’s a fairly standard URL – the sort you’d get by default from most CMSes. Compare that to this URL:

http://www.pets.com/products/7/

Continue reading