...

unique .htaccess issue

ubh
11-26-2008, 05:50 PM
Let me first break down my folder structure for the directory in question.

/products/product.php <-- PHP/MySQL Page that recived variables from URL to pull specific products

/products/productCategory/productCategory.php <-- Pulls all products from database specificly for this productCategory


Ok here my setup goes like this. User first starts at a product category page that pulls all products from database for the user to then pick and choose a product they might want to see.
/products/productCategory/productCategory.php


Once a person clicks on a product they get pointed out of this perticular product category directory and up a level to product.php.
/products/product.php


The URL sent when a user clicks on a product looks like this, domainname.com/products/productCategory/productName.php
then .htaccess takes anything after products/ and writes the url out as the following.
domainname.com/products/product.php?product_category=$productCategory&product_name=$productName.

Ok so if I type in domainname.com/products/productCategory/productName.php I do in fact get my URL rewrite to work and pull up that particular product. Problem I have now is that if I try to go back into my /products/productCategory/productCategory.php page nothing pulls up.


Here is my .htaccess file for my product.php page.

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^([^/]+)/([^/]+).php product.php?product_category=$1&product_name=$2 [NC]

Anyone know why this would fix my URLs for product.php but my product category pages wont pull up now??

ubh
11-26-2008, 10:24 PM
Never mind I figured it out. I took the .htaccess file along with my product.php page that relays URL variables to pull from the database and put them both into a sub folder so the .htaccess file only gets called within this new sub folder and never acts as a gateway to my category pages.

Thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum