I am displaying a record from a database by passing a GET parameter into a url: <http://example.com/record?id=2>

The record has a field named "title" that I would like to use to rewrite the url to display like this:
<http://example.com/record/title>

Example: <http://example.com/record/This-is-the-Record-Title>

Inside the page I have a variable $title that pulls the "title" value from the record. How can I use the $title variable to rewrite the variable like shown in the example above?