You are here:  » product link

Support Forum



product link

Submitted by philstone on Thu, 2009-11-12 14:40 in

Hi David

i've installed the new script on my site, all going to plan slowly, on the search, category, brand and merchant pages the link to the product has .net/product/?.html in it, but its set to redirect to .net/?.html, how can i fix the link so that /product/ is not in the link in the first place

thanks

philip

Submitted by support on Thu, 2009-11-12 15:29

Hi Philip,

Are you trying to recreate a modification from your old site whereby you removed the /product/ virtual directory from the URL?

This will require a modification to .htaccess, and a change to the way the product URL is generated in search.php.

In .htaccess, add the following code to the very end of the file:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ products.php?q=$1&rewrite=1&%{QUERY_STRING} [L]

...and then in search.php look for the following code beginning at line 270:

      if ($config_useRewrite)
      {
        $searchresults["products"][$k]["productHREF"] = $config_baseHREF."product/".tapestry_hyphenate($product["normalised_name"]).".html";
      }
      else
      {
        $searchresults["products"][$k]["productHREF"] = $config_baseHREF."products.php?q=".urlencode($product["normalised_name"]);
      }

...and REPLACE with just:

      $searchresults["products"][$k]["productHREF"] = $config_baseHREF.tapestry_hyphenate($product["normalised_name"]).".html";

Hope this helps!

Cheers,
David.

Submitted by philstone on Thu, 2009-11-12 15:43

perfect dave

thankyou!!!

regards

Phil Stone
www.buy24-7.net

Submitted by philstone on Sat, 2010-11-13 01:25

Hi David

just having a play with the beta version, loving it, how would the above work on the new version?

regards

Phil Stone
www.buy24-7.net

Submitted by support on Mon, 2010-11-15 09:00

Hi Phil,

The .htaccess modifications are the same - but the product link generation has moved to includes/tapestry.php. In that file, look for the following code at line 53:

return $config_baseHREF."product/".urlencode(tapestry_hyphenate($product["normalised_name"])).".html";

...and REPLACE with:

return $config_baseHREF.urlencode(tapestry_hyphenate($product["normalised_name"])).".html";

Cheers,
David.
--
PriceTapestry.com