For rewriting two parameters, the rule would be a bit longer, but not much more complex:
Go ahead and put this to work in a quick exercise.
Rewriting Numeric URLs
folder, modify the
script that you created earlier like this:
// display product details
echo ‘You have selected product #‘ . $_GET[‘product_id’] .
‘ from category #‘ . $_GET[‘category_id’];
Test your script by loading
in your web browser. You should get the expected output as shown
in Figure 3-9.
Change the current rewriting rule in your
file as shown in the following code. Also
remove any old rules, because they wouldn’t work well with the new
which receives two parameters now.
# Rewrite numeric URLs
Note that the entire
command and its parameters must be written on a single line in
file. If you split it in two lines as printed in the book, you’ll get a 500 error from the
web server when trying to load scripts from that folder.
Chapter 3: Provocative SE-Friendly URLs
c03.qxd:c03 10:39 62
Bitcoin Dice Site