I have links on my site which look like this: products.php?prodid=11 category.php?categid=9 I have heard that I need this thing called mod_rewrite to write the URLs to something easier to remember and more search engine-friendly. I have been reading about mod_rewrite all day, and I am finding it hard to understand. Can anyone clarify, please, how to do the following? Change category.php?categid=9 to category/furniture And what about pagination? When I land on category.php?categid=9 and click to Page 2, the URL changes to category.php?categid=9&page=2. How do I implement mod_rewrite here?
I stay confused on this subject myself but am very slowly coming to terms with it. I currently believe that you have to have the rewrite functions in Apache and within the scripts to make maximum utilization of it. When you hover over a link it should show the rewritten URL there as well as in the browser window. The second part of your question the is another rewrite and should look like category/furniture/page/2/ or category/furniture/page2.html whichever you want. I hope I added something but I fear I only rambled on.
Thanks for the effort, Colbyt. I no longer need help with this matter, guys. I just noticed that there's a sticky dedicated to the subject.
For category.php?categid=9 to match category/furniture you would need the script to know that furniture is ID 9. The easiest way to do it with no change to the script needed except changing the link part, is to keep the number in there, category/9/furniture Options +FollowSymLinks +Indexes RewriteEngine on RewriteBase / RewriteRule ^category/([^.]+)/([^.]+)$ category.php?categid=$1 [L] with the script knowing to add furniture to the link.