Rewriting your urls to clean permanent looking links
There are several articles out there on using mod_rewrite and .htaccess to convert from dynamic pages with query strings in the urls, to a cleaner more permanent looking link. But even after reading the documentation on RewriteCond and RewriteRule it took me a few hours of experimentation to get the desired effect. So I thought I would share my settings to help serve as examples for others trying to do something similar. Using PHP and MySQL I have pages that are dynamically created from a database. The URLs for those pages look like: http://budgetweb.com/budgetweb/details.php?id= 2825 &provider= CravisHostFive I wanted to use mod_rewrite so that the links in my feed would look like http://budgetweb.com/service/ 2825 / CravisHostFive / Here's what I added to the .htaccess in the root of my web site RewriteEngine on RewriteRule ^service/ ([0-9]+) / ([^/]*) /$ /budgetweb/details.php?id= $1 &provider= $2 I also wanted to handle links typed in which did not have the trailing sla