Sites provides built-in logic that helps you display user-friendly URLs and links to site visitors. Create rules to rewrite URL requests typed into the address bar, launched from bookmarks, or linked from external websites. You can also create rules to rewrite the URLs for links within site pages. URL rewriting not only makes URLs more descriptive and intuitive for users, it allows search engines to better index your site pages.
For example, let's say that you have a blog site. Without URL rewriting, a blog entry's URL might look like this: http://myblog.force.com/posts?id=003D000000Q0PcN
To rewrite URLs for a site, create an Apex class that maps the original URLs to user-friendly URLs, and then add the Apex class to your site.
The following are methods for UrlRewriter. All are instance methods.
public System.PageReference[] generateUrlFor(System.PageReference[] salesforceUrls)
Type: System.PageReference[]
You can use List<PageReference> instead of PageReference[], if you prefer.
The size and order of the input list of Salesforce URLs must exactly correspond to the size and order of the generated list of user-friendly URLs. The generateUrlFor method maps input URLs to output URLs based on the order in the lists.
public System.PageReference mapRequestUrl(System.PageReference userFriendlyUrl)
Type: System.PageReference