You are here:  » products in url rewrite


products in url rewrite

Submitted by pat on Tue, 2011-06-28 16:37 in

Hello

Is there an easy way to replace

RewriteRule ^product/(.*).html$ products.php?q=$1&rewrite=1&%{QUERY_STRING} [L]

by

RewriteRule ^produit/(.*).html$ products.php?q=$1&rewrite=1&%{QUERY_STRING} [L]

ou

RewriteRule ^whatever/(.*).html$ products.php?q=$1&rewrite=1&%{QUERY_STRING} [L]

?? in order to get different urls for sites using the same feeds?

Thanks

Pat

Submitted by support on Tue, 2011-06-28 16:53

Hi Pat,

I know you've just installed the latest version so yes - just a single change required to the code to support an arbitrary /product-page/ rewrite, together with the corresponding change in .htaccess.

For example, to use /produit/ instead of /product/, in includes/tapestry.php search for the following code at line 53 (within the tapestry_productHREF() function:

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

...and REPLACE with:

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

Finally, the corresponding change will be required in your .htaccess, by simply replacing each instance of

product/

with:

produit/

Cheers,
David.
--
PriceTapestry.com