webtarget Posted January 29, 2012 Share Posted January 29, 2012 Hi, I am trying to fix a rewrite that is not working, I was wondering if someone could help. My site is located here: http://www.dianfurniture.com/reproduction/shop-furniture.php?ProductCatalogID=0 The rewrite issue is with the categories on the left hand side. The view-source for the categories looks like this: <ul> <li><a href="/furniture/All Items/0.html">All Items</a></li> <li><a href="/furniture/Bedroom Furniture/1.html">Bedroom Furniture</a></li> <li><a href="/furniture/Benches and Stools/2.html">Benches and Stools</a></li> <li><a href="/furniture/Cabinets/3.html">Cabinets</a></li> <li><a href="/furniture/Chairs/4.html">Chairs</a></li> <li><a href="/furniture/Coffee Tables/5.html">Coffee Tables</a></li> <li><a href="/furniture/Console Tables/6.html">Console Tables</a></li> <li><a href="/furniture/Dining Furniture/7.html">Dining Furniture</a></li> <li><a href="/furniture/Doll Furniture/8.html">Doll Furniture</a></li> <li><a href="/furniture/End Tables/9.html">End Tables</a></li> <li><a href="/furniture/Other Furniture/11.html">Other Furniture</a></li> <li><a href="/furniture/Plant Stands/12.html">Plant Stands</a></li> <li><a href="/furniture/Unfinished Furniture/14.html">Unfinished Furniture</a></li> </ul> <ul> My htaccess looks like this: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^product/(.*)/([0-9]+)/(.*)?$ /reproduction/itemlisting.php?ProductID=$2 RewriteRule ^furniture/(.*)/([0-9]+)(\.html)?$ /reproduction/shop-furniture.php?ProductCatalogID=$2 <reference 1> RewriteRule ^furniture/([0-9]+)\.html/([0-9]+) /reproduction/shop-furniture.php?ProductCatalogID=$1&20=$2 <reference 2> </IfModule> But, line2 <reference 1> and <reference 2> do not seem to be working. Can someone please tell me what is wrong with the rewrite rule? Notes: The htaccess file is in my root. The directories (product and furniture) do not actually exist. <reference 1> and <reference 2> are not actually in my htaccess file. Quote Link to comment https://forums.phpfreaks.com/topic/255991-htaccess-rewrite-not-working/ Share on other sites More sharing options...
webtarget Posted February 3, 2012 Author Share Posted February 3, 2012 got it working. Unfortunately, I created a directory with the same name in the rewritten url. So, I believe it looked for an htaccess file in there. Once I deleted the directory, my website worked. Quote Link to comment https://forums.phpfreaks.com/topic/255991-htaccess-rewrite-not-working/#findComment-1314210 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.