Creating a Vanity URL with a htaccess Rewrite Rule
I'm trying to set up my site so that users can have a "vanity url".
To do this, I added the following rewrite rule to the htaccess file:
RewriteRule ^([A-Za-z0-9]+)[^.]$ view.html?id=$1 [nc]
Here's what this does.
If the user goes to http://www.domain.com/vanityurl it will Rewrite the url to view.html?id=vanityurl
If the filename has a dot in it, like .html, .htm, or .php, it will ignore the rule.
Hopefully this helps someone out there on the interwebs.