Hi everyone. Sorry about this, but this is driving me crazy, I can't seem to get an htaccess rewrite rule to work. I have a category page url page.php?MerchantCategory=Bras&Manufacturer=&OfferDescription=&sizes= and want to change it to page-X-X-X-X.htm but whatever I do it just doesn't seem to work. My htaccess is as follows, the other rewrite rules work correctly. Options +FollowSymLinks RewriteEngine On RewriteRule ^detail_([^\.]+)\.htm$ detail.php?recordID=$1 RewriteRule ^buy_([^\.]+)\.html$ out.php?recordID=$1 RewriteRule ^([^\.]+)\.html$ designer.php?Manufacturer=$1 RewriteRule ^index_([0-9]+)_([0-9]+)\.htm$ index.php?pageNum_Recordset1=$1&totalRows_Recordset1=$2 RewriteRule ^cats-([^.]+)-([^.]+)-([^.]+)-([^.]+).htm$ page.php?MerchantCategory=$1&Manufacturer=$2&OfferDescription=$3&sizes=$4 I know the above is a bit of a mess, but I just want to get the structure working before I tidy up a bit Many Thanks Rob
Yes, that was just the last in a long long line of edits and stuff to rey and get it working. The latest is... RewriteRule page-category-(.*)-manufacturer-(.*)-description-(.*)-sizes-(.*).htm$ page.php?merchantcategory=$1&manufacturer=$2&offerdescription=$3&sizes=$4 The url for the site is http://www.temptation-lingerie.co.uk Rob
You not think that you defeating the object a little as you are still creating a very long unfriendly URL. Have you thought about / rather - might make it easier to follow and be more SEO...None of my biz anyhow Try adding [R] flag to try and debugg which part is going wrong
I will shorten it later, I needed the long bit, as my brain is currently dribbling out of my ear as no matter what I do, it won't play ball.
RewriteRule page-category-(.+)-manufacturer-(.+)-description-(.+)-sizes-(.+).htm$ page.php?merchantcategory=$1&manufacturer=$2&offerdescription=$3&sizes=$4 Code (markup): Is working for me so long as their is a var foreach ie. <a href='page-category-1-manufacturer-2-description-3-sizes-4.htm'>1234 Code (markup):
Hmmm, the thought had crossed my mind as I was eating my jelly and ice cream (Sons birthday tea) that I don't have a value for each one. So, is there any way round that? Rob
For some reason I get no producst but the page displays. Original url http://www.temptation-lingerie.co.uk/page.php?MerchantCategory=Non-underwired&Manufacturer=&OfferDescription=&sizes= After the rewrite http://www.temptation-lingerie.co.uk/page-category-Non-underwired-manufacturer--description--sizes-.htm Rule RewriteRule page-category-(.*)-manufacturer-(.*)-description-(.*)-sizes-(.*).htm$ page.php?merchantcategory=$1&manufacturer=$2&offerdescription=$3&sizes=$4 I might just compromise and change the lookups.
I take it that Non-underired should be one var becuase the rewrite rule will see it as Non being one var ude to the - It may be handy to add this to the page to verify the information that should and is being posted echo "<pre>"; print_r($_GET); echo "</pre>"; Code (markup):
Yep, but I don't think thats the problem as I also tried with a single entry. http://www.temptation-lingerie.co.uk/page-category-Bras-manufacturer--description--sizes-.htm I was trying to be clever and save myself a bit of time in doing multiple mapge, should have known better. Thanks for your help, I will change some of the code to strip down the refs. I know the other htaccess rules are working as the index paging works fine. http://www.temptation-lingerie.co.uk/index_01_4503.htm Rob