Forum Moderators: phranque
Welcome to WebmasterWorld.
The best place to start is in the library, and then the charter (links at the top left of the pages). That should get you going, then when you have something you have tried we will help you make it work.
You are basically going the wrong way... should link to the friendly URL then rewrite the information from the dynamic one to that.
Justin
RewriteEngine on
RewriteRule ^userprofile/(.+)\.htm$ h++p://www.domain.com/userprofile.php?username=$1 [L]
Note that the [L] is on the same line, just one space between it and the $1.
Depending on valid characters for usernames, you could make this more efficient. If lowercase a-z are the only valid characters, then replacing (.+) with ([a-z]+) would be more efficient. Also note that the ++'s should be t's in the URL; I changed them out so it wouldn't turn it into a link on the forum.