iAreku Posted June 1, 2014 Share Posted June 1, 2014 (edited) Hi!I'm coming from a "Loaded Commerce" software solution where, in my old store, all my products have numeric "model names", ie. basket ball model: 949439 tennis ball model: 200299 football ball model: 348994 So i had the following rewrite condition in my .htaccess file: RewriteRule ^([0-9]+)$ q.php?modx=$1&%{QUERY_STRING} which called the following file (q.php): <?php require('includes/application_top.php'); $modx = $_GET['modx']; // perform the query $query = tep_db_query("select products_id from products where products_model = $modx"); $query_result_array = tep_db_fetch_array($query); if ($query_result_array[products_id]){ /* Redirect browser */ $pxx = $query_result_array[products_id]; header("Location: product_info.php?products_id=$pxx"); /* Make sure that code below does not get executed when we redirect. */ exit; } else { echo "not found"; } ?> So whenever anyone types the url: www.mystore.com/modelnumber (aka www.mystore.com/349438) gets straight to that product details page (aka www.mystore.com/that-ball-with-that-model-number.html) But im not sure how can i port this to "prestashop environment", that is, an sql query to the db, fill it to the array and "paint" the array into the location: url... Any1 kind to help?Thanks!! Edited June 1, 2014 by iAreku (see edit history) Link to comment Share on other sites More sharing options...
Dh42 Posted June 1, 2014 Share Posted June 1, 2014 You can set the model number as a the reference number in Prestashop. Then from the SEO and urls page you can make it use the reference number for the product address. It is going to be not that great for seo though, I would let prestashop name them with the product name and use this module, http://www.presto-changeo.com/en/prestashop-migration-modules/95-cre-loaded-url-redirect.html to redirect the pages so you do not lose link juice. Link to comment Share on other sites More sharing options...
iAreku Posted June 16, 2014 Author Share Posted June 16, 2014 Dh42, Thanks for the tip, but im not quite sure if i understood it right. You mean to set the model number to the product id? Also not sure what redirects have to do here (i mean 30x), its just a rewrite what i need... sort of META HTTP redirect but htaccess rewritten.... Link to comment Share on other sites More sharing options...
Dh42 Posted June 16, 2014 Share Posted June 16, 2014 I am saying you need a redirect for SEO reasons. If you rewrite the link you are going to have duplicate content. Link to comment Share on other sites More sharing options...
Recommended Posts