Well I would suggest giving each product a category (that has a cat number) and then within each category, give each product number (id). Then the address would be something like: products.php?cat=5&id=1
With that you could also use it to browse each category with one PHP script.
Try looking at some popular shopping sites such as Amazon and see how they do it. It's always best to learn from the Pro's!!!
the ban= is actually the category id, and cat= is actually the product id.
I am trying to figure out how I can get the url to reflect the product's name instead of ban & cat. How exactly to get it to call the product name from the database instead of those two. And if possible will it have a negative effect if there is more than one product with the same name?
How about then using something like this:
Amazon uses a system that has a product name with spaces replaced with dashes and then a number (Probably the product number). Example of a Amazon URL:
Well basically the way my site works is this. It is dynamic. I have only four hard coded pages. These four pages are the ones that produce dynamic URLs.
categories_and_featured_products.php, subcategories_and_featured_products.php, products.php, and productsincategories.php.
Now the pages pull information from the MYSQL database whenever someone browses the sight, so to someone who is not tech savvy it seems as if we have thousands and thousands of pages. Really those thousands of pages are only four pages with different information generated each time. For example the 'mobile electronics: mp4' page's url looks like this:
First, you do not need to declare the options and enable the rewriteengine more than once at the top of the file.
Also, I am assuming products and catagories will only be numbers, this being the case it would be good practice to only allow numbers in the query string rather than anything.
This can be done by putting ([0-9]+) which means only allow characters 0 through 9 and the + means 1 or more.
Thanks alot. I myself have little programming experience, so whatever information is given is helpful. Actually, products and categories will be less numbers and more actual text. We are reforming that for SEO purposes as well. Can I safely remove the 0-9, or should it be replaced with an alternative?
I would suggest looking into regex extensively as there are many options for this.
if you are using letters, you can define which particular ones you will allow any whether they are caps, lower case or case insensitive.
In rewrites your regex goes in the (), conditions go in the  and modifiers go between the ] and ), for example, to allow all lower or upper character(Latin, Greek, and Cyrillic character sets only) use ([a-zA-z]+) if you want to internationalize and allow accented characters you would use ([a-z]+) and add [NC] to the end of the line.
Take a search online for regex, specifically for mod_rewrite as there are slight differences you need to use in the .htaccess file compared to some programming/scripting languages.