So I've taken over a project a friend of mine had started but didn't have the time to finish. It's an online e-commerce system built with CodeIgniter. The problem is, every product's url is setup like site.com/store/viewProduct?id=3 with the ID as the identifier. Now I am okay with keeping the ID in the URL, but I would like to make it so the ? is removed and the product title is also added in as well. So the final URL would be like site.com/store/viewProduct/3/cake-cutter or something like that.
The controller functions all reference to $_GET['id']; as well. I know I will have to change that as well... but to what?
I tried changing the URLs to like shown above and then using $this->uri->segment(1,0); to get the product id, but I got an error.
I will use CodeIgniters built in url_title(); function to generate the product names, but what is the easiest way to go about changing these urls?