Hi David
Is there a way to amend my jump.php file so it returns the correct http response, and a message to the user if a retailer link (e.g. jump.php?id=123456789) no longer exists.
I realise I can add 'rel=nofollow' and disallow in robots.txt to stop Google indexing them, but I also feel that returning the correct response, and a message to the customer is the right thing to do.
Many Thanks!
Yes they are cached links in Google.
Great solution as always, thanks David.
Is there a way for the jump urls to never change for same existing products after a new feed import & And all newly added products get a new jump url & products that no longer exist get the 404.html page?
Hi,
Sure - you can link to jump.php with the dupe_hash which will always be identical for the same (merchant + product name) combination. To do this, first edit jump.php and look for the following code at line 4:
$sql = "SELECT filename,buy_url FROM `".$config_databaseTablePrefix."products` WHERE id='".database_safe($_GET["id"])."'";
...and REPLACE with:
$sql = "SELECT filename,buy_url FROM `".$config_databaseTablePrefix."products` WHERE dupe_hash='".database_safe($_GET["id"])."'";
And then in includes/tapestry.php look for the following code at line 101:
return $config_baseHREF."jump.php?id=".$product["id"];
...and REPLACE with:
return $config_baseHREF."jump.php?id=".$product["dupe_hash"];
Cheers,
David.
--
PriceTapestry.com
Works fine on products.php page when linking out to merchant's site. But when using the search.php it gives a blank jump id & broken page error. My search.php is linking direct to merchant on searches. Jump is empty on these pages.
Hi Rocket32,
Ah sorry about that - the dupe_hash field isn't included by the search SELECT sql so that needs to be added, that's all. In search.php look for the following code at line 374:
$sql2 = "SELECT id,name,normalised_name,image_url,description,price,rating FROM `".$config_databaseTablePrefix."products` WHERE id IN (".$in.")";
...and REPLACE with:
$sql2 = "SELECT id,name,normalised_name,image_url,description,price,rating,dupe_hash FROM `".$config_databaseTablePrefix."products` WHERE id IN (".$in.")";
Cheers,
David.
--
PriceTapestry.com
Jump id is still coming back blank on search results.
Hi,
Sure - in jump.php you will find this code on line 6:
database_querySelect($sql,$rows);
...simply REPLACE that with:
if (!database_querySelect($sql,$rows))
{
header("HTTP/1.0 404 Not Found");
require("404.html");
}
In addition, create a new file - 404.html in the same directory as jump.php containing the HTML of a page you wish to display when a link no longer exists.
(note that these pages shouldn't be appearing on your site live, so I guess these are cached pages that are sending users to invalid jump IDs...)
Hope this helps!
Cheers,
David.