I needed to rewrite the URLs for DotNetNuke for SEO purposes. Here's how to do it.
1. Open the SiteURLs.config file located in the root directory. Optionally, use the Friendly URL settings interface in Host Settings.
2. Figure out what you want the URL to be and how to write the URL with Querystrings. Add an entry in the SiteURLs.config file like below. Regular expressions can be used, but because I want each page to show up a particular way, I have to explicitly specify each one. Lookfor is the one you want to show up, and Sendto is the real URL with querystring.
<RewriterRule>
<LookFor>.*/HorsebackRiding/MendesRanch.htm</LookFor>
<SendTo>~/Default.aspx?tabid=78&Activity=378</SendTo>
</RewriterRule>
3. Because I wanted to use the extension .htm in place of .aspx, I had to associate the .htm application extention with the aspnet_isapi.dll. To get there in IIS 6, right click the site you're working with in iis and click properties. Click Home Directory, configuration, and locate the .htm extension. Add it if necessary, because it wasn't there when I looked. Associate with the appropriate verbs - I selected the All Verbs option. Check the Script Engine box and uncheck the verify that file exists box. Click ok.