Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    ubh
    ubh is offline
    Regular Coder ubh's Avatar
    Join Date
    Apr 2008
    Location
    Portland, Oregon U.S.A.
    Posts
    443
    Thanks
    108
    Thanked 15 Times in 14 Posts

    unique .htaccess issue

    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??

  • #2
    ubh
    ubh is offline
    Regular Coder ubh's Avatar
    Join Date
    Apr 2008
    Location
    Portland, Oregon U.S.A.
    Posts
    443
    Thanks
    108
    Thanked 15 Times in 14 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •