Want a cool site? Want it to look purty? Here’s how.
Let’s say you already have the site. catolog.php has the catolog, item.php?id=1 has the item viewer, and checkout.php?id=1 lets you check out. I will be showing you a script to pretty up these URLs.
RewriteEngine on RewriteRule ^catalog/?$ /catalog.php RewriteRule ^item/([0-9]+)/?$ /item.php?id=$1 RewriteRule ^checkout/([0-9]+)/?$ /checkout.php?id=$1
This makes pretty URLs using .htaccess. Explanation of the item thing. First, it defines item/ as a valid virtual directory. Then, ([0-9]+) tells it to save any numerical value as $1. Finally, /? means it’ll work with or without an ending slash. Now, it transparently redirects to item.php?id=$1 where $1 is the item number.
Hope this helps!