We recently launched a ProductCart site to replace the product details of our company site. The main site with general company info, video webscasts, free patterns, etc. is at http://www.leisurearts.com - www.leisurearts.com . The ProductCart site is shop.leisurearts.com.
I rewrote the Page_Load routine for the item detail page on the other site so that it takes the item number that is passed in our previous SEO-friendly URLs, looks it up from the SKU field in the Products table, then builds a new URL to the ProuctCart SEO-friendly URL for that item and does a 301 redirect. Where I'm running into trouble is with item names/titles that have special characters in them, like the trademark symbol ™, the registered trademark symbol ®, and smart apostrophes/single right quotes ’ . I wrote my own VB function in our .net site:
TitleForURLUse = inputURL TitleForURLUse = TitleForURLUse.Replace(Chr(34), "") TitleForURLUse = TitleForURLUse.Replace(":", "") TitleForURLUse = TitleForURLUse.Replace("'", "") TitleForURLUse = TitleForURLUse.Replace(" ", "-") TitleForURLUse = TitleForURLUse.Replace("&", "and") TitleForURLUse = TitleForURLUse.Replace(",", "") TitleForURLUse = TitleForURLUse.Replace("/", "") TitleForURLUse = TitleForURLUse.Replace("+", "") TitleForURLUse = TitleForURLUse.Replace(".", "") TitleForURLUse = TitleForURLUse.Replace("!", "") TitleForURLUse = TitleForURLUse.Replace(Chr(13), "") TitleForURLUse = TitleForURLUse.Replace(Chr(10), "")
which obviously isn't covering those special charcters, and so on those items with these odd characters in the title, I'm not generating the same SEO-friendly URL as ProductCart, and the redirect is failing because PC can't find the item.
Can someone point me to the code in ProductCart that is used for making the SEO-friendly URLs, so I can make sure I cover the same characters and redirect to a correctly-formed URL?
|