Hi David
Trust you are well.
I'm noticed a problem for many visitors coming to my site.
my sitemaps have obviously given google normalised product pages (prior to mapping)
eg: site.com/LG-55LW650T-55quot-Full-HD-LED-3D-TV.html, but in my product mapping the product was mapped to site.com/LG-55LW650T.html by entering the line
=LG 55LW650T 55" Full HD LED 3D TV
in product mapping, when i type in
site.com/LG 55LW650T 55" Full HD LED 3D TV.html (the actual original product name) it diverts to site.com/LG-55LW650T.html no problem
is there a simple fix for this so that when either is typed in or the page is landed on that it automatically diverts to site.com/LG-55LW650T.html
without having to manually remapp ever product for the product title with characters and without characters?
Regards
Philip
(I hope this makes sense)
Hi Philip,
Bear in mind that once mapped, your sitemap will only ever contain the Normalised-Name.html version of the mapped product name, and search engines should expire any other versions over time.
I recall making the modification for you and I checked the code that I sent at the time and as you say it is only doing the attempt to look-up the new name using the exact value that comes is as $q so it would be straight forward to make it use the raw, un-normalised version also. In your products.php, based on the last version I sent, look for the following code at line 104:
$sql = "SELECT * FROM `".$config_databaseTablePrefix."productsmap` WHERE alternates LIKE '%".database_safe($q)."%' LIMIT 1";
...and REPLACE with:
$sql = "SELECT * FROM `".$config_databaseTablePrefix."productsmap` WHERE alternates LIKE '%".database_safe($q)."%' OR alternates LIKE '%".database_safe($_GET["q"])."%' LIMIT 1";
I'm not 100% sure this is exactly the solution you are looking for; as essentially it is impossible to "un-normalise" a string since there is no record of which characters were removed from where (for example " is converted to just quot) however what I would suggest is looking further at why this is happening. Make sure for example that your sitemap has been updated recently (it should be requested periodically by Google anyway) so perhaps double-check that it is still registered in your Webmaster Tools account) as if it were no longer there for some reason that would exaplain why you are still receiving traffic to pre-mapped product name URLS...
Hope this helps! If you're still not sure drop me an email with a few example URLs / search results showing incorrect product URLs, together with a copy of your latest products.php and I'll take a further look...
Cheers,
David.
--
PriceTapestry.com